mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
Fixing example.bro's auto-reST generation baseline test.
Adds a diff canonifier that skips diffing the places where example.bro may use MutableVal derivatives (e.g. sets/tables), which don't always generate the same ordering in the reST docs across runs.
This commit is contained in:
parent
2bc5e69961
commit
c472931eb9
4 changed files with 18 additions and 2 deletions
|
@ -13,7 +13,7 @@ these comments are transferred directly into the auto-generated
|
||||||
`reStructuredText <http://docutils.sourceforge.net/rst.html>`_
|
`reStructuredText <http://docutils.sourceforge.net/rst.html>`_
|
||||||
(reST) document's summary section.
|
(reST) document's summary section.
|
||||||
|
|
||||||
.. tip:: You can embed directives and roles within ``##``-stylized comments
|
.. tip:: You can embed directives and roles within ``##``-stylized comments.
|
||||||
|
|
||||||
:Author: Jon Siwek <jsiwek@ncsa.illinois.edu>
|
:Author: Jon Siwek <jsiwek@ncsa.illinois.edu>
|
||||||
|
|
||||||
|
|
15
testing/btest/Scripts/doc/example-diff-canonifier.py
Executable file
15
testing/btest/Scripts/doc/example-diff-canonifier.py
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
|
# MutableVal derivatives (e.g. sets/tables) don't always generate the same
|
||||||
|
# ordering in the reST documentation, so just don't bother diffing
|
||||||
|
# the places where example.bro uses them.
|
||||||
|
|
||||||
|
RE1 = "\d*/tcp"
|
||||||
|
RE2 = "tcp port \d*"
|
||||||
|
|
||||||
|
for line in sys.stdin.readlines():
|
||||||
|
if re.search(RE1, line) is None and re.search(RE2, line) is None:
|
||||||
|
print line
|
|
@ -12,5 +12,6 @@ BRO_SEED_FILE=%(testbase)s/random.seed
|
||||||
PATH=%(testbase)s/../../build/src:%(testbase)s/../../aux/btest:%(default_path)s
|
PATH=%(testbase)s/../../build/src:%(testbase)s/../../aux/btest:%(default_path)s
|
||||||
TEST_DIFF_CANONIFIER=%(testbase)s/Scripts/diff-canonifier
|
TEST_DIFF_CANONIFIER=%(testbase)s/Scripts/diff-canonifier
|
||||||
TRACES=%(testbase)s/Traces
|
TRACES=%(testbase)s/Traces
|
||||||
|
SCRIPTS=%(testbase)s/Scripts
|
||||||
DIST=%(testbase)s/../..
|
DIST=%(testbase)s/../..
|
||||||
BUILD=%(testbase)s/../../build
|
BUILD=%(testbase)s/../../build
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
@TEST-EXEC: bro --doc-scripts $DIST/doc/example.bro
|
@TEST-EXEC: bro --doc-scripts $DIST/doc/example.bro
|
||||||
@TEST-EXEC: btest-diff example.rst
|
@TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/doc/example-diff-canonifier.py btest-diff example.rst
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue