updates for gen-C++ maintenance, including skipping some inappropriate tests

This commit is contained in:
Vern Paxson 2022-08-01 16:47:17 -07:00
parent c034dc68ed
commit 7a41170a59
36 changed files with 200 additions and 53 deletions

View file

@ -495,7 +495,7 @@ void CPPCompile::GenForOverTable(const ExprPtr& tbl, const IDPtr& value_var,
StartBlock();
Emit("auto k__CPP = lve__CPP.GetHashKey();");
Emit("auto* current_tev__CPP = lve__CPP.GetValue<TableEntryVal*>();");
Emit("auto* current_tev__CPP = lve__CPP.value;");
Emit("auto ind_lv__CPP = tv__CPP->RecreateIndex(*k__CPP);");
if ( value_var )

View file

@ -15,7 +15,7 @@ The maintenance workflow:
to check in updates to the list of how the compiler currently fares
on various btests (see end of this doc):
Thu May 12 12:54:10 PDT 2022
Mon Aug 1 16:39:05 PDT 2022
2. Run "find-test-files.sh" to generate a list (to stdout) of all of the
possible Zeek source files found in the test suite.
@ -57,17 +57,27 @@ These BTests won't successfully run due to the indicated issue:
command-line-error - a deliberate command-line error
complex-to-debug - hard-to-figure-out failure
deprecated - uses features deprecated for -O C++
error-handling - behavior in face of an error differs
needs-plugin - requires knowing how to build an associated plugin
no-script - there's no actual script to compile
ZAM - meant specifically for -O ZAM
Consider migrating these to have @TEST-REQUIRES clauses so we don't have
to maintain this list.
../testing/btest/core/negative-time.test no-script
../testing/btest/core/pcap/dumper.zeek no-script
../testing/btest/core/pcap/input-error.zeek command-line-error
../testing/btest/core/proc-status-file.zeek no-script
../testing/btest/core/scalar-vector.zeek deprecated
../testing/btest/language/at-if-event.zeek @if
../testing/btest/language/at-if.zeek @if
../testing/btest/language/at-ifdef.zeek @if
../testing/btest/language/at-ifndef.zeek @if
../testing/btest/language/incr-vec-expr.test deprecated
../testing/btest/language/uninitialized-local2.zeek error-handling
../testing/btest/language/vector-deprecated.zeek deprecated
../testing/btest/language/vector-in-operator.zeek
../testing/btest/language/vector-in-operator.zeek deprecated
../testing/btest/language/when-aggregates.zeek bad-when
../testing/btest/opt/opt-files.zeek ZAM
@ -76,6 +86,7 @@ These BTests won't successfully run due to the indicated issue:
../testing/btest/opt/opt-func.zeek ZAM
../testing/btest/opt/opt-func2.zeek ZAM
../testing/btest/opt/opt-func3.zeek ZAM
../testing/btest/plugins/packet-protocol.zeek needs-plugin
../testing/btest/scripts/base/protocols/dhcp/dhcp-ack-msg-types.zeek no-script
../testing/btest/scripts/base/protocols/dhcp/dhcp-all-msg-types.zeek no-script
../testing/btest/scripts/base/protocols/dhcp/dhcp-discover-msg-types.zeek no-script

View file

@ -1,8 +1,19 @@
#! /bin/sh
out=out.$(echo $1 | sed 's,\.\./,,;s,/,#,g')
abbr=$(echo $1 | sed 's,\.\./,,;s,/,#,g')
out=CPP-test/out.$abbr
gen_out=CPP-test/gen.$abbr
(
/bin/echo -n $1" "
(src/zeek -O gen-C++ --optimize-files=testing/btest --optimize-func="<global-stmts>" $1 >&/dev/null && echo "success") || echo "fail"
) >CPP-test/$out 2>&1
if ! src/zeek -O gen-C++ --optimize-files=testing/btest $1 >&$gen_out 2>&1; then
echo "fail"
exit 1
fi
if grep -E -q 'deprecated|skipping|cannot compile|no matching functions' $gen_out; then
echo "fail"
exit 1
fi
echo "success"
exit 0
) >$out 2>&1

View file

@ -1,11 +1,22 @@
#! /bin/sh
rm -f CPP-gen.cc
cp zeek.HOLD src/zeek || (
echo Need to create clean zeek.HOLD
exit 1
) || exit 1
if [ "$1" == "-U" ]; then
btest_opt=-U
shift
elif [ "$1" == "-d" ]; then
btest_opt=-d
shift
else
btest_opt=-d
fi
base=$(echo $1 | sed 's,\.\./,,;s,/,#,g')
rel_test=$(echo $1 | sed 's,.*testing/btest/,,')
@ -26,5 +37,5 @@ ninja
(
cd ../testing/btest
../../auxil/btest/btest -a cpp -d -f ../../build/CPP-test/diag.$base $rel_test
../../auxil/btest/btest -a cpp $btest_opt -f ../../build/CPP-test/diag.$base $rel_test
)