mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This also installs symlinks from "zeek" and "bro-config" to a wrapper script that prints a deprecation warning. The btests pass, but this is still WIP. broctl renaming is still missing. #239
41 lines
916 B
Text
41 lines
916 B
Text
# @TEST-EXEC: zeek -b %INPUT secondtestfile >out
|
|
# @TEST-EXEC: btest-diff out
|
|
|
|
# In this source file, we define a module and export some objects
|
|
|
|
module thisisatest;
|
|
|
|
export {
|
|
global test_case: function(msg: string, expect: bool);
|
|
|
|
global testevent: event(msg: string);
|
|
|
|
global num: count = 123;
|
|
|
|
const daysperyear: count = 365;
|
|
}
|
|
|
|
function test_case(msg: string, expect: bool)
|
|
{
|
|
print fmt("%s (%s)", msg, expect ? "PASS" : "FAIL");
|
|
}
|
|
|
|
event testevent(msg: string)
|
|
{
|
|
test_case( "event", T );
|
|
}
|
|
|
|
|
|
# @TEST-START-FILE secondtestfile
|
|
|
|
# In this source file, we try to access each exported object from the module
|
|
|
|
event zeek_init()
|
|
{
|
|
thisisatest::test_case( "function", T );
|
|
thisisatest::test_case( "global variable", thisisatest::num == 123 );
|
|
thisisatest::test_case( "const", thisisatest::daysperyear == 365 );
|
|
event thisisatest::testevent( "foo" );
|
|
}
|
|
|
|
# @TEST-END-FILE
|