mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Add "# @no-test" tag to blacklist statements from test coverage analysis.
It can apply to either single statements: print "don't cover"; # @no-test or a block of statements: if ( F ) { # @no-test ... }
This commit is contained in:
parent
b6c3567ba4
commit
713e3ac5d0
6 changed files with 99 additions and 42 deletions
29
testing/btest/coverage/coverage-blacklist.bro
Normal file
29
testing/btest/coverage/coverage-blacklist.bro
Normal file
|
@ -0,0 +1,29 @@
|
|||
# @TEST-EXEC: BROFILER_FILE=coverage bro -b %INPUT
|
||||
# @TEST-EXEC: grep %INPUT coverage | sort -k2 >output
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
print "first";
|
||||
|
||||
if ( F )
|
||||
{ # @no-test
|
||||
print "hello";
|
||||
print "world";
|
||||
}
|
||||
|
||||
print "cover me";
|
||||
|
||||
if ( T )
|
||||
{
|
||||
print "always executed";
|
||||
}
|
||||
|
||||
print "don't cover me"; # @no-test
|
||||
|
||||
if ( 0 + 0 == 1 ) print "impossible"; # @no-test
|
||||
|
||||
if ( 1 == 0 )
|
||||
{
|
||||
print "also impossible, but included in code coverage analysis";
|
||||
}
|
||||
|
||||
print "success";
|
Loading…
Add table
Add a link
Reference in a new issue