Commit aa7a789e authored by Hilko Bengen's avatar Hilko Bengen

New upstream version 0.58

parent 4b6d5518
0.58 | 2018-05-21 22:32:21 +0000
* Release 0.58.
0.57-32 | 2018-05-21 22:31:42 +0000
* Show number of skipped tests even when none fail. (Daniel Thayer)
* Delete a test's temporary directory if skipped, unless the user
wants these. (Corelight)
0.57-28 | 2018-05-08 10:03:20 -0500
* BIT-1735: open btest files as utf-8 if locale has no default encoding
(Corelight)
* Normalize output of a sphinx-related unit test (Corelight)
* Improve a unicode decode error message (Daniel Thayer)
0.57-24 | 2018-04-18 14:56:56 -0700
* Improving console output. (Robin Sommer)
- When showing a progress message, always clear to end of line
to delete any content that a previous, longer message may
have left.
- Ensure to turn the cursor back on at exit.
0.57-23 | 2018-03-15 14:58:20 -0700
* Configure Travis CI email recipients and build branches. (Daniel
Thayer)
0.57-21 | 2018-02-05 15:05:43 -0800
* Add a .travis.yml file. (Daniel Thayer)
0.57-19 | 2018-01-19 15:14:02 -0800
* Fix a bug when setting base dir using a relative path. Addresses
BIT-1892. (Daniel Thayer)
* Improve testing of setting a non-default base directory. (Daniel
Thayer)
0.57-16 | 2017-11-17 15:03:16 -0800
* Fix "btest -R" to preserve sorted output ordering. (Daniel Thayer)
* Add more tests to "doc.test". (Daniel Thayer)
0.57-13 | 2017-10-23 15:35:21 -0700
* Tweak -A|--show-all to use only coloring, not cursor navigation.
(Christian Kreibich)
* Fix the doc.test. (Daniel Thayer)
* Improve the console.test and document "--show-all" option. (Daniel
Thayer)
* Added documentation of the "--show-all" option. (Daniel Thayer)
* Allow multiple TEST-DOC keywords in a test file. (Daniel Thayer)
0.57-7 | 2017-10-16 12:18:28 -0700
* Fix the console.test to work on FreeBSD and macOS. (Christian
Kreibich/Daniel Thayer)
0.57-5 | 2017-10-06 15:01:23 -0700
* Additional control over TTY-based output handling This adds
-A|--show-all, which makes console output preserve output lines
for passing/skipped tests. (Christian Kreibich)
* Fix btest-rst-cmd script to remove tmp files. (Daniel Thayer)
* Added TMPDIR to btest.cfg so that temporary files are stored in a
local directory instead of a system-wide tmp directory. (Daniel
Thayer)
0.57 | 2017-05-15 16:13:33 -0700
* Release 0.57.
......
# file GENERATED by distutils, do NOT edit
CHANGES
COPYING
MANIFEST
MANIFEST.in
Makefile
README
VERSION
btest
btest-ask-update
btest-bg-run
btest-bg-run-helper
btest-bg-wait
btest-diff
btest-progress
btest-setsid
btest.cfg.example
setup.py
Baseline/examples.t4/dots
Baseline/examples.t5/output
Baseline/examples.t5-2/output
Baseline/examples.t6/output
Baseline/examples.t7/output
examples/alternative
examples/my-filter
examples/t1
examples/t2
examples/t3.sh
examples/t4.awk
examples/t5.sh
examples/t6.sh
examples/t7
examples/t7.sh#1
examples/t7.sh#2
examples/t7.sh#3
examples/sphinx/.gitignore
examples/sphinx/Makefile
examples/sphinx/btest.cfg
examples/sphinx/conf.py
examples/sphinx/index.rst
examples/sphinx/Baseline/tests.sphinx.hello-world/btest-tests.sphinx.hello-world#1
examples/sphinx/Baseline/tests.sphinx.hello-world/btest-tests.sphinx.hello-world#2
examples/sphinx/Baseline/tests.sphinx.hello-world/btest-tests.sphinx.hello-world#3
examples/sphinx/tests/sphinx/hello-world.btest
examples/sphinx/tests/sphinx/hello-world.btest#2
examples/sphinx/tests/sphinx/hello-world.btest#3
sphinx/btest-diff-rst
sphinx/btest-rst-cmd
sphinx/btest-rst-include
sphinx/btest-rst-pipe
sphinx/btest-sphinx.py
testing/.gitignore
testing/Makefile
testing/btest.cfg
testing/btest.tests.cfg
testing/Baseline/tests.alternatives-environment/child-output
testing/Baseline/tests.alternatives-environment/output
testing/Baseline/tests.alternatives-filter/child-output
testing/Baseline/tests.alternatives-filter/output
testing/Baseline/tests.alternatives-keywords/output
testing/Baseline/tests.alternatives-substitution/child-output
testing/Baseline/tests.alternatives-substitution/output
testing/Baseline/tests.alternatives-testbase/output
testing/Baseline/tests.brief/out1
testing/Baseline/tests.brief/out2
testing/Baseline/tests.btest-cfg/output
testing/Baseline/tests.diag/output
testing/Baseline/tests.diag-all/output
testing/Baseline/tests.diag-file/diag
testing/Baseline/tests.diag-file/output
testing/Baseline/tests.diff-brief/output
testing/Baseline/tests.diff-max-lines/output1
testing/Baseline/tests.diff-max-lines/output2
testing/Baseline/tests.doc/md
testing/Baseline/tests.doc/rst
testing/Baseline/tests.environment/output
testing/Baseline/tests.exit-codes/out1
testing/Baseline/tests.exit-codes/out2
testing/Baseline/tests.groups/output
testing/Baseline/tests.ignore/output
testing/Baseline/tests.known-failure/output
testing/Baseline/tests.known-failure-succeeds/output
testing/Baseline/tests.macros/output
testing/Baseline/tests.measure-time/output
testing/Baseline/tests.measure-time-options/output
testing/Baseline/tests.parts/output
testing/Baseline/tests.parts-error-part/output
testing/Baseline/tests.parts-error-start-next/output
testing/Baseline/tests.parts-finalizer/output
testing/Baseline/tests.parts-glob/output
testing/Baseline/tests.parts-skipping/output
testing/Baseline/tests.progress/output
testing/Baseline/tests.progress-back-to-back/output
testing/Baseline/tests.quiet/out1
testing/Baseline/tests.quiet/out2
testing/Baseline/tests.requires/output
testing/Baseline/tests.rerun/output
testing/Baseline/tests.sphinx.rst-cmd/output
testing/Baseline/tests.sphinx.run-sphinx/output
testing/Baseline/tests.start-file/output
testing/Baseline/tests.start-next/output
testing/Baseline/tests.statefile/mystate1
testing/Baseline/tests.statefile/mystate2
testing/Baseline/tests.testdirs/out1
testing/Baseline/tests.testdirs/out2
testing/Baseline/tests.threads/output.j0
testing/Baseline/tests.threads/output.j1
testing/Baseline/tests.threads/output.j5
testing/Baseline/tests.verbose/output
testing/Baseline/tests.xml/output.xml
testing/Files/local_alternative/btest.tests.cfg
testing/Files/local_alternative/tests/local-alternative-found.test
testing/Scripts/diff-remove-abspath
testing/Scripts/dummy-script
testing/Scripts/strip-test-base
testing/Scripts/test-filter
testing/Scripts/test-perf
testing/tests/alternatives-environment.test
testing/tests/alternatives-filter.test
testing/tests/alternatives-keywords.test
testing/tests/alternatives-substitution.test
testing/tests/alternatives-testbase.test
testing/tests/basic-fail.test
testing/tests/basic-succeed.test
testing/tests/brief.test
testing/tests/btest-cfg.test
testing/tests/canonifier-cmdline.test
testing/tests/canonifier-fail.test
testing/tests/canonifier.test
testing/tests/copy-file.test
testing/tests/diag-all.test
testing/tests/diag-file.test
testing/tests/diag.test
testing/tests/diff-brief.test
testing/tests/diff-max-lines.test
testing/tests/diff.test
testing/tests/doc.test
testing/tests/environment.test
testing/tests/exit-codes.test
testing/tests/finalizer.test
testing/tests/groups.test
testing/tests/ignore.test
testing/tests/initializer.test
testing/tests/known-failure-succeeds.btest
testing/tests/known-failure.btest
testing/tests/macros.test
testing/tests/measure-time-options.test
testing/tests/measure-time.tests
testing/tests/parts-error-part.test
testing/tests/parts-error-start-next.test
testing/tests/parts-finalizer.test
testing/tests/parts-glob.test
testing/tests/parts-skipping.tests
testing/tests/parts.tests
testing/tests/progress-back-to-back.test
testing/tests/progress.test
testing/tests/quiet.test
testing/tests/requires.test
testing/tests/rerun.test
testing/tests/start-file.test
testing/tests/start-next-naming.test
testing/tests/start-next.test
testing/tests/statefile.test
testing/tests/test-base.test
testing/tests/testdirs.test
testing/tests/threads.test
testing/tests/tmps.test
testing/tests/verbose.test
testing/tests/xml.test
testing/tests/sphinx/rst-cmd.sh
testing/tests/sphinx/run-sphinx
Metadata-Version: 1.1
Name: btest
Version: 0.57
Version: 0.58
Summary: A simple unit testing framework
Home-page: https://github.com/bro/btest
Author: Robin Sommer
......
.. -*- mode: rst-mode -*-
..
.. Version number is filled in automatically.
.. |version| replace:: 0.57
.. |version| replace:: 0.58
============================================
BTest - A Simple Driver for Basic Unit Tests
......@@ -205,6 +205,12 @@ and 1 otherwise.
that refers to running with the standard setup, which can be used
to run tests both with and without alternatives by giving both.
-A, --show-all
Shows an output line for all tests that were run (this includes tests
that passed, failed, or were skipped), rather than only failed tests.
Note that this option has no effect when btest's stdout is not a TTY
(because all tests are shown in that case).
-b, --brief
Does not output *anything* for tests which pass. If all tests
pass, there will not be any output at all except final summary
......@@ -736,7 +742,7 @@ supported:
ignore files is by using the ``IgnoreFiles`` option in the btest
configuration file.
``@TEST-DOC <docstring>``
``@TEST-DOC: <docstring>``
Associates a documentation string with the test. These strings
get included into the output of the ``--documentation`` option.
......
This diff is collapsed.
......@@ -22,7 +22,7 @@ py_modules = [
]
setup(name='btest',
version="0.57", # Filled in automatically.
version="0.58", # Filled in automatically.
description='A simple unit testing framework',
long_description='See https://github.com/bro/btest',
author='Robin Sommer',
......
......@@ -3,7 +3,7 @@
# Executes a command and formats the command and its stdout in reST.
#
trap "rm -f $tmps; exit" INT TERM EXIT
trap cleanup INT TERM EXIT
function usage()
{
......@@ -42,6 +42,12 @@ for i in input:
"
}
function cleanup()
{
rm -f $tmps
exit
}
stdout=`mktemp -t $(basename $0).XXXXXX`
cmd_out=`mktemp -t $(basename $0).XXXXXX`
filter_out=`mktemp -t $(basename $0).XXXXXX`
......
btest-cfg ... ok
all 1 tests successful
btest-cfg ... ok
all 1 tests successful
btest-cfg ... ok
all 1 tests successful
btest-cfg ... ok
all 1 tests successful
# alternatives
* `alternatives.default`:
This test runs if no alternative is given.
* `alternatives.myalternate`:
This test runs only for the given alternative, but it will always
appear in the documentation output.
# misc
* `misc.requires`:
This is a skipped test.
# misc.subdir
* `misc.subdir.subtest`:
This test is in a subdirectory.
# multipart
* `multipart.multi`:
1st test part.
2nd test part.
3rd test part.
# testdoc
* `testdoc.badtestdoc`:
No documentation.
* `testdoc.multiline`:
This is a multi-line TEST-DOC comment.
This is the 2nd line.
This is the 3rd line.
* `testdoc.singleline`:
This is a single-line TEST-DOC comment.
* `testdoc.testdocmissing`:
No documentation.
alternatives
------------
``alternatives.default``:
This test runs if no alternative is given.
``alternatives.myalternate``:
This test runs only for the given alternative, but it will always
appear in the documentation output.
misc
----
``misc.requires``:
This is a skipped test.
misc.subdir
-----------
``misc.subdir.subtest``:
This test is in a subdirectory.
multipart
---------
``multipart.multi``:
1st test part.
2nd test part.
3rd test part.
testdoc
-------
``testdoc.badtestdoc``:
No documentation.
``testdoc.multiline``:
This is a multi-line TEST-DOC comment.
This is the 2nd line.
This is the 3rd line.
``testdoc.singleline``:
This is a single-line TEST-DOC comment.
``testdoc.testdocmissing``:
No documentation.
......@@ -2,4 +2,4 @@ t1 ... ok
t2 ... not available, skipped
t3 ... not available, skipped
t4 ... ok
all 4 tests successful
2 tests successful, 2 skipped
# This is a wrapper for the "script" command, which has different
# options depending on the OS.
if ! script -q -c ls /dev/null >/dev/null 2>&1; then
# FreeBSD and macOS
script -q /dev/null $@
else
# Linux
script -qfc "$@" /dev/null
fi
......@@ -13,4 +13,5 @@ Initializer = test -f btest.cfg || cp %(testbase)s/btest.tests.cfg btest.cfg; ec
[environment]
PATH=%(testbase)s/..:%(testbase)s/../sphinx:%(testbase)s/Scripts:%(default_path)s
SCRIPTS=%(testbase)s/Scripts
TMPDIR=%(testbase)s/.tmp
# BTEST_CFG=%(testbase)s/btest.tests.cfg
......@@ -28,4 +28,4 @@ printf=printf 'Hello, %%s'
FOO2=`echo BAR2`
[environment-local]
BTEST_TEST_BASE=../../Files/local_alternative
BTEST_TEST_BASE=local_alternative
# %TEST-EXEC: cp -r ../../Files/local_alternative .
# %TEST-EXEC: btest -a local tests/local-alternative-found.test
# %TEST-EXEC: mv btest.cfg myfile
# %TEST-EXEC: btest -c myfile %INPUT > output 2>&1
# %TEST-EXEC: BTEST_CFG=myfile btest %INPUT >> output 2>&1
# %TEST-EXEC: BTEST_CFG=notexist btest -c myfile %INPUT >> output 2>&1
# %TEST-EXEC-FAIL: btest %INPUT >> output 2>&1
# %TEST-EXEC: btest-diff output
# %TEST-EXEC: btest -c myfile %INPUT > nopath 2>&1
# %TEST-EXEC: BTEST_CFG=myfile btest %INPUT >> nopath 2>&1
# %TEST-EXEC: BTEST_CFG=notexist btest -c myfile %INPUT >> nopath 2>&1
# %TEST-EXEC-FAIL: btest %INPUT >> nopath 2>&1
# %TEST-EXEC: btest-diff nopath
# %TEST-EXEC: mkdir z
# %TEST-EXEC: mv myfile z/btest.cfg
# %TEST-EXEC: btest -c z/btest.cfg %INPUT >> relpath 2>&1
# %TEST-EXEC: BTEST_CFG=z/btest.cfg btest %INPUT >> relpath 2>&1
# %TEST-EXEC: btest-diff relpath
# %TEST-EXEC: btest -c `pwd`/z/btest.cfg %INPUT >> abspath 2>&1
# %TEST-EXEC: BTEST_CFG=`pwd`/z/btest.cfg btest %INPUT >> abspath 2>&1
# %TEST-EXEC: btest-diff abspath
@TEST-EXEC: exit 0
# %TEST-DOC: Test the "--show-all" option.
#
# %TEST-REQUIRES: which script
#
# This test doesn't work on OpenBSD, because the "script" command lacks the
# necessary options.
# %TEST-REQUIRES: test `uname` != "OpenBSD"
#
# The following uses the "script" command for two btest invocations, in order
# to verify that "btest --show-all" works correctly when btest's stdout is
# a TTY.
#
# With one failing test, one succeeding, and one skipped, plus an additional
# summary line, this makes two lines of output for the first invocation and
# four for the second.
#
# %TEST-EXEC: script-command "btest t1 t2 t3" | wc -l | awk '{print $1}' >output 2>&1
# %TEST-EXEC: script-command "btest --show-all t1 t2 t3" | wc -l | awk '{print $1}' >>output 2>&1
# %TEST-EXEC: btest-diff output
%TEST-START-FILE t1
@TEST-EXEC: echo "A successful dummy test"
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE t2
@TEST-EXEC: echo "A failing dummy test"
@TEST-EXEC: exit 1
%TEST-END-FILE
%TEST-START-FILE t3
@TEST-REQUIRES: false
@TEST-EXEC: echo "A skipped dummy test"
@TEST-EXEC: exit 0
%TEST-END-FILE
# %TEST-DOC: Tests the --documentation option and @TEST-DOC.
# %TEST-DOC: Test the --documentation option and @TEST-DOC.
# %TEST-EXEC: btest -R rst >rst
# %TEST-EXEC: btest-diff rst
# %TEST-EXEC: btest -R md >md
# %TEST-EXEC: btest-diff md
%TEST-START-FILE btest.cfg
[btest]
TestDirs = testdoc misc multipart emptydir alternatives
TmpDir = .tmp
BaselineDir = Baseline
%TEST-END-FILE
%TEST-START-FILE testdoc/singleline
@TEST-DOC: This is a single-line TEST-DOC comment.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE testdoc/testdocmissing
# This test does not have a TEST-DOC keyword.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE testdoc/multiline
@TEST-DOC: This is a multi-line TEST-DOC comment.
@TEST-DOC: This is the 2nd line.
@TEST-EXEC: exit 0
@TEST-DOC: This is the 3rd line.
%TEST-END-FILE
%TEST-START-FILE testdoc/badtestdoc
@TEST-DOC This comment will not appear in output (missing colon after TEST-DOC).
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE misc/requires.test
# This test will not run due to TEST-REQUIRES, but is always documented.
@TEST-REQUIRES: false
@TEST-DOC: This is a skipped test.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE misc/subdir/subtest.test
@TEST-DOC: This test is in a subdirectory.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE multipart/multi.test
# Test if TEST-DOC works for a multi-part test.
@TEST-DOC: 1st test part.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE multipart/multi.test#2
@TEST-DOC: 2nd test part.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE multipart/multi.test#3
@TEST-DOC: 3rd test part.
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE emptydir/ignoretest
@TEST-DOC: This file is ignored (and does not appear in documentation output).
@TEST-IGNORE
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE alternatives/myalternate
@TEST-DOC: This test runs only for the given alternative, but it will always
@TEST-DOC: appear in the documentation output.
@TEST-ALTERNATIVE: myalternative
@TEST-EXEC: exit 0
%TEST-END-FILE
%TEST-START-FILE alternatives/default
@TEST-DOC: This test runs if no alternative is given.
@TEST-ALTERNATIVE: default
@TEST-EXEC: exit 0
%TEST-END-FILE
......@@ -3,4 +3,6 @@
# %TEST-EXEC: cp -r %DIR/../../../examples/sphinx/* .
# %TEST-EXEC: make clean && make
# %TEST-EXEC: sed -n '/id=.testing/,/id=.indices/p' _build/html/index.html >output
# Newer versions of sphinx (~1.7.0+) add notranslate tags to code blocks
# %TEST-EXEC: cat output | sed 's/ notranslate//g' > tmpout && mv tmpout output
# %TEST-EXEC: btest-diff output
# %TEST-EXEC: mkdir -p x/y/z
# %TEST-EXEC: mv %INPUT x/y/z/new-test
# %TEST-EXEC: BTEST_TEST_BASE=x/y btest z/new-test
# %TEST-EXEC: BTEST_TEST_BASE=`pwd`/x/y btest z/new-test
@TEST-EXEC: echo Hello, World!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment