run-tests: Don't build all tests for mingw32uwp, restrict it to the specific uwp-error test
Build one single test to verify that building generic code for mingw32uwp works, but skip building all of the tests for this target. Keep building the uwp-error test for all targets, to verify that it builds successfully for mingw32 but fails for mingw32uwp. This reduces the runtime for the tests by around a third.
This commit is contained in:
1 parent
6b9b4ef1e3
commit
551b046498
1 file changed
+31
-27
+31
-27
@@ -70,6 +70,7 @@ TESTS_SSP="stacksmash"
|
|||||||
TESTS_ASAN="stacksmash"
|
TESTS_ASAN="stacksmash"
|
||||||
TESTS_UBSAN="ubsan"
|
TESTS_UBSAN="ubsan"
|
||||||
TESTS_UWP="uwp-error"
|
TESTS_UWP="uwp-error"
|
||||||
|
TESTS_OTHER_TARGETS="hello"
|
||||||
for arch in $ARCHS; do
|
for arch in $ARCHS; do
|
||||||
case $arch in
|
case $arch in
|
||||||
i686|x86_64)
|
i686|x86_64)
|
||||||
@@ -89,32 +90,44 @@ for arch in $ARCHS; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
for target_os in $TARGET_OSES; do
|
TEST_DIR="$arch"
|
||||||
TEST_DIR="$arch-$target_os"
|
|
||||||
mkdir -p $TEST_DIR
|
mkdir -p $TEST_DIR
|
||||||
for test in $TESTS_C; do
|
for test in $TESTS_C; do
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test.exe
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test.exe
|
||||||
|
done
|
||||||
|
for target_os in $TARGET_OSES; do
|
||||||
|
# Check that some generic tests build successfully for other targets.
|
||||||
|
# These tests are included in other groups, so skip the for the default
|
||||||
|
# mingw32 target, only test them for e.g. UWP.
|
||||||
|
# These tests are only built, not run, because the Windows Store specific
|
||||||
|
# CRT DLL isn't usually available outside of such a context.
|
||||||
|
if [ "$target_os" = "mingw32" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
for test in $TESTS_OTHER_TARGETS; do
|
||||||
|
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test-$target_os.exe
|
||||||
|
done
|
||||||
done
|
done
|
||||||
for test in $TESTS_C_DLL; do
|
for test in $TESTS_C_DLL; do
|
||||||
$arch-w64-$target_os-clang $test.c -shared -o $TEST_DIR/$test.dll -Wl,--out-implib,$TEST_DIR/lib$test.dll.a
|
$arch-w64-mingw32-clang $test.c -shared -o $TEST_DIR/$test.dll -Wl,--out-implib,$TEST_DIR/lib$test.dll.a
|
||||||
done
|
done
|
||||||
for test in $TESTS_C_LINK_DLL; do
|
for test in $TESTS_C_LINK_DLL; do
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test.exe -L$TEST_DIR -l${test%-main}-lib
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test.exe -L$TEST_DIR -l${test%-main}-lib
|
||||||
done
|
done
|
||||||
TESTS_EXTRA=""
|
TESTS_EXTRA=""
|
||||||
for test in $TESTS_C_NO_BUILTIN; do
|
for test in $TESTS_C_NO_BUILTIN; do
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test-no-builtin.exe -fno-builtin
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test-no-builtin.exe -fno-builtin
|
||||||
TESTS_EXTRA="$TESTS_EXTRA $test-no-builtin"
|
TESTS_EXTRA="$TESTS_EXTRA $test-no-builtin"
|
||||||
done
|
done
|
||||||
for test in $TESTS_C_ANSI_STDIO; do
|
for test in $TESTS_C_ANSI_STDIO; do
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test-ansi-stdio.exe -D__USE_MINGW_ANSI_STDIO=1
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test-ansi-stdio.exe -D__USE_MINGW_ANSI_STDIO=1
|
||||||
TESTS_EXTRA="$TESTS_EXTRA $test-ansi-stdio"
|
TESTS_EXTRA="$TESTS_EXTRA $test-ansi-stdio"
|
||||||
done
|
done
|
||||||
for test in $TESTS_CPP $TESTS_CPP_EXCEPTIONS; do
|
for test in $TESTS_CPP $TESTS_CPP_EXCEPTIONS; do
|
||||||
$arch-w64-$target_os-clang++ $test.cpp -o $TEST_DIR/$test.exe
|
$arch-w64-mingw32-clang++ $test.cpp -o $TEST_DIR/$test.exe
|
||||||
done
|
done
|
||||||
for test in $TESTS_CPP_EXCEPTIONS; do
|
for test in $TESTS_CPP_EXCEPTIONS; do
|
||||||
$arch-w64-$target_os-clang++ $test.cpp -O2 -o $TEST_DIR/$test-opt.exe
|
$arch-w64-mingw32-clang++ $test.cpp -O2 -o $TEST_DIR/$test-opt.exe
|
||||||
done
|
done
|
||||||
if [ "$arch" != "aarch64" ] || [ -n "$NATIVE_AARCH64" ]; then
|
if [ "$arch" != "aarch64" ] || [ -n "$NATIVE_AARCH64" ]; then
|
||||||
for test in $TESTS_CPP_EXCEPTIONS; do
|
for test in $TESTS_CPP_EXCEPTIONS; do
|
||||||
@@ -122,24 +135,20 @@ for arch in $ARCHS; do
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
for test in $TESTS_CPP_LOAD_DLL; do
|
for test in $TESTS_CPP_LOAD_DLL; do
|
||||||
case $target_os in
|
$arch-w64-mingw32-clang++ $test.cpp -o $TEST_DIR/$test.exe
|
||||||
# DLLs can't be loaded without a Windows package
|
|
||||||
mingw32uwp) continue ;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
$arch-w64-$target_os-clang++ $test.cpp -o $TEST_DIR/$test.exe
|
|
||||||
TESTS_EXTRA="$TESTS_EXTRA $test"
|
TESTS_EXTRA="$TESTS_EXTRA $test"
|
||||||
done
|
done
|
||||||
for test in $TESTS_CPP_DLL; do
|
for test in $TESTS_CPP_DLL; do
|
||||||
$arch-w64-$target_os-clang++ $test.cpp -shared -o $TEST_DIR/$test.dll
|
$arch-w64-mingw32-clang++ $test.cpp -shared -o $TEST_DIR/$test.dll
|
||||||
done
|
done
|
||||||
for test in $TESTS_SSP; do
|
for test in $TESTS_SSP; do
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test.exe -fstack-protector-strong
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test.exe -fstack-protector-strong
|
||||||
done
|
done
|
||||||
|
for target_os in $TARGET_OSES; do
|
||||||
for test in $TESTS_UWP; do
|
for test in $TESTS_UWP; do
|
||||||
set +e
|
set +e
|
||||||
# compilation should fail for UWP and WinRT
|
# compilation should fail for UWP and WinRT
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test.exe -Wimplicit-function-declaration -Werror
|
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test-$target_os.exe -Wimplicit-function-declaration -Werror
|
||||||
UWP_ERROR=$?
|
UWP_ERROR=$?
|
||||||
set -e
|
set -e
|
||||||
case $target_os in
|
case $target_os in
|
||||||
@@ -151,7 +160,7 @@ for arch in $ARCHS; do
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ $UWP_ERROR -eq 0 ]; then
|
if [ $UWP_ERROR -eq 0 ]; then
|
||||||
TESTS_EXTRA="$TESTS_EXTRA $test"
|
TESTS_EXTRA="$TESTS_EXTRA $test-$target_os"
|
||||||
else
|
else
|
||||||
echo "$test failed to compile for non-UWP target!"
|
echo "$test failed to compile for non-UWP target!"
|
||||||
exit 1
|
exit 1
|
||||||
@@ -159,13 +168,14 @@ for arch in $ARCHS; do
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
done
|
||||||
for test in $TESTS_ASAN; do
|
for test in $TESTS_ASAN; do
|
||||||
case $arch in
|
case $arch in
|
||||||
# Sanitizers on windows only support x86.
|
# Sanitizers on windows only support x86.
|
||||||
i686|x86_64) ;;
|
i686|x86_64) ;;
|
||||||
*) continue ;;
|
*) continue ;;
|
||||||
esac
|
esac
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test-asan.exe -fsanitize=address -g -gcodeview -Wl,-pdb,$TEST_DIR/$test-asan.pdb
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test-asan.exe -fsanitize=address -g -gcodeview -Wl,-pdb,$TEST_DIR/$test-asan.pdb
|
||||||
# Only run these tests on native windows; asan doesn't run in wine.
|
# Only run these tests on native windows; asan doesn't run in wine.
|
||||||
if [ -n "$NATIVE" ]; then
|
if [ -n "$NATIVE" ]; then
|
||||||
TESTS_EXTRA="$TESTS_EXTRA $test"
|
TESTS_EXTRA="$TESTS_EXTRA $test"
|
||||||
@@ -178,7 +188,7 @@ for arch in $ARCHS; do
|
|||||||
i686|x86_64) ;;
|
i686|x86_64) ;;
|
||||||
*) continue ;;
|
*) continue ;;
|
||||||
esac
|
esac
|
||||||
$arch-w64-$target_os-clang $test.c -o $TEST_DIR/$test.exe -fsanitize=undefined
|
$arch-w64-mingw32-clang $test.c -o $TEST_DIR/$test.exe -fsanitize=undefined
|
||||||
TESTS_EXTRA="$TESTS_EXTRA $test"
|
TESTS_EXTRA="$TESTS_EXTRA $test"
|
||||||
done
|
done
|
||||||
DLL="$TESTS_C_DLL $TESTS_CPP_DLL"
|
DLL="$TESTS_C_DLL $TESTS_CPP_DLL"
|
||||||
@@ -186,11 +196,6 @@ for arch in $ARCHS; do
|
|||||||
if [ "$arch" = "i686" ]; then
|
if [ "$arch" = "i686" ]; then
|
||||||
compiler_rt_arch=i386
|
compiler_rt_arch=i386
|
||||||
fi
|
fi
|
||||||
if [ "$target_os" != "mingw32" ]; then
|
|
||||||
# The Windows Store specific CRT DLL is usually not available
|
|
||||||
# outside of such contexts, so skip trying to run those tests.
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
for i in libc++ libunwind libssp-0 libclang_rt.asan_dynamic-$compiler_rt_arch; do
|
for i in libc++ libunwind libssp-0 libclang_rt.asan_dynamic-$compiler_rt_arch; do
|
||||||
if [ -f $PREFIX/$arch-w64-mingw32/bin/$i.dll ]; then
|
if [ -f $PREFIX/$arch-w64-mingw32/bin/$i.dll ]; then
|
||||||
cp $PREFIX/$arch-w64-mingw32/bin/$i.dll $TEST_DIR
|
cp $PREFIX/$arch-w64-mingw32/bin/$i.dll $TEST_DIR
|
||||||
@@ -214,5 +219,4 @@ for arch in $ARCHS; do
|
|||||||
done
|
done
|
||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
done
|
|
||||||
echo All tests succeeded
|
echo All tests succeeded
|
||||||
Reference in new issue
Block a user