Build tests in a separate subdirectory for each arch

This eases cases when testcases contain DLLs, whose names won't
contain the arch name.
This commit is contained in:
Martin Storsjö committed 2018-08-13 23:49:08 +03:00
1 parent cef45a8937
commit 0448bd616a
2 files changed
+19 -10

No files matched your search

+4 -2
View File
@@ -55,8 +55,9 @@ ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH
COPY test/*.c ./test/
RUN cd test && \
for arch in $TOOLCHAIN_ARCHS; do \
mkdir -p $arch && \
for test in hello hello-tls crt-test setjmp; do \
$arch-w64-mingw32-clang $test.c -o $test-$arch.exe || exit 1; \
$arch-w64-mingw32-clang $test.c -o $arch/$test.exe || exit 1; \
done; \
done
@@ -68,8 +69,9 @@ RUN ./build-libcxx.sh $TOOLCHAIN_PREFIX
COPY test/*.cpp ./test/
RUN cd test && \
for arch in $TOOLCHAIN_ARCHS; do \
mkdir -p $arch && \
for test in hello-cpp hello-exception tlstest-main; do \
$arch-w64-mingw32-clang++ $test.cpp -o $test-$arch.exe || exit 1; \
$arch-w64-mingw32-clang++ $test.cpp -o $arch/$test.exe || exit 1; \
done; \
$arch-w64-mingw32-clang++ tlstest-lib.cpp -shared -o tlstest-lib-$arch.dll || exit 1; \
done
+15 -8
View File
@@ -15,19 +15,24 @@ cd test
TESTS_C="hello hello-tls crt-test setjmp"
TESTS_C_NO_BUILTIN="crt-test"
TESTS_CPP="hello-cpp hello-exception tlstest-main"
TESTS_CPP_DLL="tlstest-lib"
for arch in $ARCHS; do
mkdir -p $arch
for test in $TESTS_C; do
$arch-w64-mingw32-clang $test.c -o $test-$arch.exe
$arch-w64-mingw32-clang $test.c -o $arch/$test.exe
done
TESTS_EXTRA=""
for test in $TESTS_C_NO_BUILTIN; do
$arch-w64-mingw32-clang $test.c -o $test-no-builtin-$arch.exe -fno-builtin
$arch-w64-mingw32-clang $test.c -o $arch/$test-no-builtin.exe -fno-builtin
TESTS_EXTRA="$TESTS_EXTRA $test-no-builtin"
done
for test in $TESTS_CPP; do
$arch-w64-mingw32-clang++ $test.cpp -o $test-$arch.exe
$arch-w64-mingw32-clang++ $test.cpp -o $arch/$test.exe
done
$arch-w64-mingw32-clang++ tlstest-lib.cpp -shared -o tlstest-lib-$arch.dll
for test in $TESTS_CPP_DLL; do
$arch-w64-mingw32-clang++ $test.cpp -shared -o $arch/$test.dll
done
DLL="$TESTS_CPP_DLL"
case $arch in
i686|x86_64)
RUN=wine
@@ -42,12 +47,14 @@ for arch in $ARCHS; do
COPY="$COPY_AARCH64"
;;
esac
cp tlstest-lib-$arch.dll tlstest-lib.dll
cd $arch
if [ -n "$COPY" ]; then
$COPY tlstest-lib.dll
for i in $DLL; do
$COPY $i.dll
done
fi
for test in $TESTS_C $TESTS_CPP $TESTS_EXTRA; do
file=$test-$arch.exe
file=$test.exe
if [ -n "$COPY" ]; then
$COPY $file
fi
@@ -55,5 +62,5 @@ for arch in $ARCHS; do
$RUN $file
fi
done
rm -f tlstest-lib.dll
cd ..
done