mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
utils: Introduce packages.zeek with can_load() helper
This commit is contained in:
parent
704f75a214
commit
947294efab
5 changed files with 54 additions and 0 deletions
32
testing/btest/scripts/base/utils/packages.zeek
Normal file
32
testing/btest/scripts/base/utils/packages.zeek
Normal file
|
@ -0,0 +1,32 @@
|
|||
# @TEST-EXEC: zeek -b %INPUT >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
@load base/utils/packages
|
||||
|
||||
@if ( can_load("pkg1") )
|
||||
@load pkg1
|
||||
@endif
|
||||
|
||||
@if ( can_load("pkg2") )
|
||||
@load pkg2
|
||||
@endif
|
||||
|
||||
@if ( can_load("pkg3") )
|
||||
@load pkg3
|
||||
@else
|
||||
print "no pkg3";
|
||||
@endif
|
||||
|
||||
@TEST-START-FILE pkg1.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
print "pkg1!";
|
||||
}
|
||||
@TEST-END-FILE
|
||||
|
||||
@TEST-START-FILE pkg2/__load__.zeek
|
||||
event zeek_init()
|
||||
{
|
||||
print "pkg2!";
|
||||
}
|
||||
@TEST-END-FILE
|
Loading…
Add table
Add a link
Reference in a new issue