zeek/testing/btest/spicy/multiple-enum.zeek
Benjamin Bannier 8049d3a002 Speed up Spicy-related tests.
This patch changes invocations of `spicyz` and similar Spicy tools in
tests which perform compilation to use debug mode via passing `-d`. This
in turn leads to Spicy compiling generated C++ code in debug as opposed
to release mode which typically seems to require less CPU time and RAM.
For a local test running with `btest -j 16` and no caching via
`HILTI_CXX_COMPILER_LAUNCER` this sped up running of BTests under
`spicy/` by about 40s on my machine (120s vs 160s).
2023-05-25 14:59:10 +02:00

41 lines
844 B
Text

# @TEST-REQUIRES: have-spicy
#
# @TEST-EXEC: spicyz -d -o test.hlto dtest.spicy ./dtest.evt
# @TEST-EXEC: zeek -r ${TRACES}/ssh/single-conn.trace test.hlto %INPUT | sort >output
# @TEST-EXEC: btest-diff output
event dtest_one(x: dtest::RESULT) {
print "one", x;
}
event dtest_two(x: dtest::RESULT) {
print "two", x;
}
# @TEST-START-FILE dtest.evt
protocol analyzer spicy::dtest over TCP:
parse originator with dtest::Message,
port 22/tcp;
on dtest::Message if ( self.sswitch == 83 )
-> event dtest_one(self.result);
on dtest::Message if ( self.sswitch != 83 )
-> event dtest_two(self.result);
# @TEST-END-FILE
# @TEST-START-FILE dtest.spicy
module dtest;
public type RESULT = enum {
A, B = 83, C, D, E, F
};
public type Message = unit {
sswitch: uint8;
result: uint8 &convert=RESULT($$);
};
# @TEST-END-FILE