btest/plugin: Add plugin testing enum identifiers

This plugin has a generic name, but for now just tests the API around
enum types and enum vals at InitPostScript() time.
This commit is contained in:
Arne Welzel 2025-04-04 09:52:46 +02:00
parent ab87ba9786
commit cb610bdea2
5 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,26 @@
# @TEST-DOC: A plugin testing some parts Zeek's C++ API
# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Demo API
# @TEST-EXEC: cp -r %DIR/api-plugin/* .
#
# @TEST-EXEC: ./configure --zeek-dist=${DIST} && make
#
# @TEST-EXEC: ZEEK_PLUGIN_PATH=`pwd` zeek %INPUT >output
#
# @TEST-EXEC: TEST_DIFF_CANONIFIER= btest-diff output
module DemoAPI;
export {
type Severity: enum {
CRITICAL = 1,
ERROR = 2,
WARNING = 3,
INFO = 4,
};
}
module User;
redef enum DemoAPI::Severity += {
USER_DEBUG = 50,
};