mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00

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).
41 lines
844 B
Text
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
|