diff --git a/testing/btest/Baseline/core.check-unused-event-handlers/.stderr b/testing/btest/Baseline/core.check-unused-event-handlers/.stderr index 808ae449a1..a695ee772a 100644 --- a/testing/btest/Baseline/core.check-unused-event-handlers/.stderr +++ b/testing/btest/Baseline/core.check-unused-event-handlers/.stderr @@ -9,3 +9,4 @@ warning in , line 1: event handler never invoked: SupervisorControl::sta warning in , line 1: event handler never invoked: SupervisorControl::stop_request warning in , line 1: event handler never invoked: spicy_analyzer_for_mime_type warning in , line 1: event handler never invoked: this_is_never_used +warning in , line 1: event this_is_never_used (<...>/check-unused-event-handlers.test:5): cannot be invoked diff --git a/testing/btest/Baseline/core.option-runtime-errors-8/.stderr b/testing/btest/Baseline/core.option-runtime-errors-8/.stderr index 66435b589a..8db3e3a4ca 100644 --- a/testing/btest/Baseline/core.option-runtime-errors-8/.stderr +++ b/testing/btest/Baseline/core.option-runtime-errors-8/.stderr @@ -1,2 +1,3 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +warning: event option_changed (<...>/option-runtime-errors.zeek:4): cannot be invoked error in <...>/option-runtime-errors.zeek, line 7: Option::on_change needs function argument; not hook or event (Option::set_change_handler(A, to_any_coerceoption_changed, (coerce 0 to int))) diff --git a/testing/btest/Baseline/language.table-type-checking/out b/testing/btest/Baseline/language.table-type-checking/out index 54a8b0534d..0e6a3b7cd3 100644 --- a/testing/btest/Baseline/language.table-type-checking/out +++ b/testing/btest/Baseline/language.table-type-checking/out @@ -14,4 +14,4 @@ error in port and <...>/table-type-checking.zeek, line 42: type clash (port and error in <...>/table-type-checking.zeek, line 42: inconsistent types in table constructor (table(thousand-two = 1002)) error in <...>/table-type-checking.zeek, line 48: type clash in assignment (lea = table(thousand-three = 1003)) error in count and <...>/table-type-checking.zeek, line 54: arithmetic mixed with non-arithmetic (count and foo) -error in <...>/table-type-checking.zeek, line 4 and <...>/table-type-checking.zeek, line 54: &default value has inconsistent type (MyTable and table()&default=foo, &optional) +error in <...>/table-type-checking.zeek, line 4 and <...>/table-type-checking.zeek, line 54: &default value has inconsistent type (table[port] of count and table()&default=foo, &optional) diff --git a/testing/btest/core/check-unused-event-handlers.test b/testing/btest/core/check-unused-event-handlers.test index 742a07554c..2d2fe68e14 100644 --- a/testing/btest/core/check-unused-event-handlers.test +++ b/testing/btest/core/check-unused-event-handlers.test @@ -1,7 +1,7 @@ # This test should print a warning that the event handler is never invoked. # @TEST-REQUIRES: $SCRIPTS/have-spicy # This test logs uninvoked event handlers, so disable it if Spicy and its plugin is unavailable. # @TEST-EXEC: zeek -b %INPUT check_for_unused_event_handlers=T -# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff .stderr +# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort-and-remove-abspath btest-diff .stderr event this_is_never_used() { diff --git a/testing/btest/language/closure-sending-naming.zeek b/testing/btest/language/closure-sending-naming.zeek index f77c8e50b5..c58d651c49 100644 --- a/testing/btest/language/closure-sending-naming.zeek +++ b/testing/btest/language/closure-sending-naming.zeek @@ -76,7 +76,7 @@ type myfunctype: function(c: count) : function(d: count) : count; global global_with_same_name = 100; -global pong: event(msg: string, f: myfunctype); +global pong: event(msg: string, f: myfunctype) &is_used; # This is one, of many, ways to declare your functions that you plan to receive. # All you are doing is giving the parser a version of their body, so they can be @@ -116,7 +116,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) global n = 0; -event ping(msg: string, f: myfunctype) +event ping(msg: string, f: myfunctype) &is_used { print fmt("receiver got ping: %s", msg); ++n; diff --git a/testing/scripts/diff-sort-and-remove-abspath b/testing/scripts/diff-sort-and-remove-abspath new file mode 100755 index 0000000000..f071ce1c70 --- /dev/null +++ b/testing/scripts/diff-sort-and-remove-abspath @@ -0,0 +1,3 @@ +#! /usr/bin/env bash +# +diff-sort | diff-remove-abspath