mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 03:08:38 +01:00
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 <lfleischer@lfos.de> Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
parent
229f85794f
commit
bf5573f86c
@ -12,14 +12,14 @@ incdir="${top_srcdir}/include/bsd"
|
|||||||
CPPFLAGS="$CPPFLAGS -DLIBBSD_OVERLAY"
|
CPPFLAGS="$CPPFLAGS -DLIBBSD_OVERLAY"
|
||||||
|
|
||||||
for inc in $(cd $incdir; find -name '*.h' | sort | cut -c3-); do
|
for inc in $(cd $incdir; find -name '*.h' | sort | cut -c3-); do
|
||||||
cat >headers-gen.c <<SOURCE
|
cat >headers-overlay-gen.c <<SOURCE
|
||||||
#include <$inc>
|
#include <$inc>
|
||||||
int main() { return 0; }
|
int main() { return 0; }
|
||||||
SOURCE
|
SOURCE
|
||||||
|
|
||||||
echo "testing header $inc"
|
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
|
echo
|
||||||
|
|
||||||
rm -f headers-gen*
|
rm -f headers-overlay-gen*
|
||||||
done
|
done
|
||||||
|
@ -11,14 +11,14 @@ run()
|
|||||||
incdir="${top_srcdir}/include"
|
incdir="${top_srcdir}/include"
|
||||||
|
|
||||||
for inc in $(cd $incdir; find -name '*.h' | sort | cut -c3-); do
|
for inc in $(cd $incdir; find -name '*.h' | sort | cut -c3-); do
|
||||||
cat >headers-gen.c <<SOURCE
|
cat >headers-system-gen.c <<SOURCE
|
||||||
#include <$inc>
|
#include <$inc>
|
||||||
int main() { return 0; }
|
int main() { return 0; }
|
||||||
SOURCE
|
SOURCE
|
||||||
|
|
||||||
echo "testing header $inc"
|
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
|
echo
|
||||||
|
|
||||||
rm -f headers-gen.*
|
rm -f headers-system-gen.*
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user