From: Lukas Fleischer Date: Thu, 7 Jan 2016 16:26:12 +0000 (+0100) Subject: test: Fix race condition in headers-*.sh X-Git-Tag: 0.8.2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf5573f86ca0b042b3f56d4c65913d5825c82ffe;p=thirdparty%2Flibbsd.git test: Fix race condition in headers-*.sh When running tests in parallel (e.g. using `make -j4 check`), the header tests currently fail due to headers-overlay.sh and headers-system.sh both generating headers-gen.c simultaneously, resulting in garbled output. Fix this by using separate C files for the tests. Signed-off-by: Lukas Fleischer Signed-off-by: Guillem Jover --- diff --git a/test/headers-overlay.sh b/test/headers-overlay.sh index 56ce90d..be92eff 100755 --- a/test/headers-overlay.sh +++ b/test/headers-overlay.sh @@ -12,14 +12,14 @@ incdir="${top_srcdir}/include/bsd" CPPFLAGS="$CPPFLAGS -DLIBBSD_OVERLAY" for inc in $(cd $incdir; find -name '*.h' | sort | cut -c3-); do - cat >headers-gen.c <headers-overlay-gen.c < int main() { return 0; } SOURCE echo "testing header $inc" - run $CC -isystem "$incdir" $CPPFLAGS headers-gen.c -o /dev/null + run $CC -isystem "$incdir" $CPPFLAGS headers-overlay-gen.c -o /dev/null echo - rm -f headers-gen* + rm -f headers-overlay-gen* done diff --git a/test/headers-system.sh b/test/headers-system.sh index 173fcc5..5ff0517 100755 --- a/test/headers-system.sh +++ b/test/headers-system.sh @@ -11,14 +11,14 @@ run() incdir="${top_srcdir}/include" for inc in $(cd $incdir; find -name '*.h' | sort | cut -c3-); do - cat >headers-gen.c <headers-system-gen.c < int main() { return 0; } SOURCE echo "testing header $inc" - run $CC -isystem "$incdir" $CPPFLAGS headers-gen.c -o /dev/null + run $CC -isystem "$incdir" $CPPFLAGS headers-system-gen.c -o /dev/null echo - rm -f headers-gen.* + rm -f headers-system-gen.* done