Fix script_opt/cpp test scripts to work correctly on all platforms

This commit is contained in:
Tim Wojtulewicz 2023-07-17 12:27:27 -07:00 committed by Tim Wojtulewicz
parent c9f6b3463f
commit 067bbf82fb
4 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@ gen_out=CPP-test/gen.$abbr
( (
/bin/echo -n $1" " /bin/echo -n $1" "
if ! src/zeek -O gen-C++ --optimize-files=testing/btest $1 >&$gen_out 2>&1; then if ! src/zeek -O gen-C++ --optimize-files=testing/btest $1 >$gen_out 2>&1; then
echo "fail" echo "fail"
exit 1 exit 1
fi fi

View file

@ -1,4 +1,4 @@
#! /bin/sh #! /bin/sh
/bin/echo -n $1" " /bin/echo -n $1" "
(src/zeek --parse-only $1 >&/dev/null && echo "success") || echo "fail" (src/zeek --parse-only $1 >/dev/null 2>&1 && echo "success") || echo "fail"

View file

@ -7,10 +7,10 @@ cp zeek.HOLD src/zeek || (
exit 1 exit 1
) || exit 1 ) || exit 1
if [ "$1" == "-U" ]; then if [ "$1" = "-U" ]; then
btest_opt=-U btest_opt=-U
shift shift
elif [ "$1" == "-d" ]; then elif [ "$1" = "-d" ]; then
btest_opt=-d btest_opt=-d
shift shift
else else
@ -32,7 +32,7 @@ export ZEEK_OPT_FILES="testing/btest"
) )
# export -n ZEEK_GEN_CPP ZEEK_CPP_DIR ZEEK_OPT_FUNCS ZEEK_OPT_FILES # export -n ZEEK_GEN_CPP ZEEK_CPP_DIR ZEEK_OPT_FUNCS ZEEK_OPT_FILES
export -n ZEEK_GEN_CPP ZEEK_REPORT_UNCOMPILABLE ZEEK_CPP_DIR ZEEK_OPT_FILES unset ZEEK_GEN_CPP ZEEK_REPORT_UNCOMPILABLE ZEEK_CPP_DIR ZEEK_OPT_FILES
ninja ninja

View file

@ -5,6 +5,6 @@ find ../testing/btest -type f |
grep -E '\.(zeek|test)$' | grep -E '\.(zeek|test)$' |
sort | sort |
xargs grep -E -l '^[ ]*(event|print)' | xargs grep -E -l '^[ ]*(event|print)' |
xargs grep -E -lc 'REQUIRES.*CPP.*((!=.*1)|(==.*0))' | xargs grep -E -c 'REQUIRES.*CPP.*((!=.*1)|(==.*0))' |
grep ':0$' | grep ':0$' |
sed 's,:0,,' sed 's,:0,,'