BTest updates in support of compiling-scripts-to-C++

This commit is contained in:
Vern Paxson 2024-12-12 14:30:23 -08:00
parent 0a813a53c7
commit 8876ec6f2d
10 changed files with 35 additions and 29 deletions

View file

@ -1 +0,0 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.

View file

@ -1 +0,0 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.

View file

@ -1 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
Run 0
Run 1
Run 2
Run 3

View file

@ -1,3 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
event(), []
event(s:string), [abc]
===, 0, {
}
===, 1, {
[[id=1, foo=<uninitialized>]] = [id=2, foo=[id=1, foo=<uninitialized>]]
}

View file

@ -1,5 +1,8 @@
# Verifies analyzer ID retrieval from a connection.
#
# Not compatible with -O gen-C++ due to use of multiple scripts.
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
#
# @TEST-EXEC: zeek -b -r ${TRACES}/ssh/ssh-on-port-80.trace %INPUT >output
# @TEST-EXEC: btest-diff output

View file

@ -7,21 +7,18 @@ event zeek_init()
local _ = "1";
}
#@TEST-START-NEXT
event zeek_init()
{
local _: string = "1";
local _: count = 1;
}
#@TEST-START-NEXT
event zeek_init()
{
local _: string = "1";
const _: count = 1;
}
#@TEST-START-NEXT
event zeek_init()
{
const _: string = "1";

View file

@ -1,6 +1,6 @@
# @TEST-EXEC: zeek -b %INPUT
# @TEST-EXEC: cp .stderr output
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff output
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stderr
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff .stdout
redef exit_only_after_terminate = T;

View file

@ -34,23 +34,3 @@ event zeek_init()
# This will be size 1
print "===", |tbl|, tbl;
}
#@TEST-START-NEXT
type Foo: record {
id: string;
};
redef record Foo += {
foo: Foo &optional;
};
event zeek_init()
{
local tbl: table[Foo] of Foo;
local f1 = Foo($id="1");
local f2 = Foo($id="2", $foo=f1);
print "===", |tbl|, tbl;
tbl[f1] = f2;
print "===", |tbl|, tbl;
}

View file

@ -0,0 +1,20 @@
# @TEST-EXEC: zeek -b %INPUT >output
# @TEST-EXEC: btest-diff output
type Foo: record {
id: string;
};
redef record Foo += {
foo: Foo &optional;
};
event zeek_init()
{
local tbl: table[Foo] of Foo;
local f1 = Foo($id="1");
local f2 = Foo($id="2", $foo=f1);
print "===", |tbl|, tbl;
tbl[f1] = f2;
print "===", |tbl|, tbl;
}