nim-chronicles/tests
Zahary Karadjov 94e8e2b2e8 run the new testrunner on 'nimble test' 2018-10-19 18:22:46 +03:00
..
colors #20 Add test file os property 2018-10-17 13:59:49 +02:00
loglevel #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
logscope #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
other #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
perf #20 Add first set of tests 2018-10-15 16:45:27 +02:00
rt_filtering #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
sinks #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
streams #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
timestamps #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
topics #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
README.md #20 Add test file os property 2018-10-17 13:59:49 +02:00
custom_stream.nim more prominent display of the 'topics' property in the default formatters; close #13 2018-07-16 17:48:25 +03:00
dynamic_scopes.nim Initial version of the library 2018-04-25 23:08:27 +03:00
file_log_stream.nim fix #7 2018-06-19 16:26:45 +03:00
lexical_scopes.nim more prominent display of the 'topics' property in the default formatters; close #13 2018-07-16 17:48:25 +03:00
long_lines.nim Imlement the syslog output and the Trace log level (Close #26) 2018-09-02 01:00:44 +03:00
multiple_streams.nim #20 Add first set of tests 2018-10-15 16:45:27 +02:00
runtime_filtering.nim #20 Add more tests and update existing tests 2018-10-15 16:45:27 +02:00
runtime_path.nim v0.2.0: Support for specifying the log file paths at run-time 2018-06-19 16:01:26 +03:00
size.nim #20 Add first set of tests 2018-10-15 16:45:27 +02:00
test_config.nim #20 Add test file os property 2018-10-17 13:59:49 +02:00
test_helpers.nim #20 Add file check + fix possible wrong failure message (multiple outputs) + update timestamp peg 2018-10-15 16:59:37 +02:00
testrunner.nim #20 Add test file os property 2018-10-17 13:59:49 +02:00
topics_and_loglvls.nim #20 Add first set of tests 2018-10-15 16:45:27 +02:00
xml_stream.nim more prominent display of the 'topics' property in the default formatters; close #13 2018-07-16 17:48:25 +03:00
xml_stream_usage.nim Few experimental implementations of public logScopes 2018-05-05 19:22:21 +03:00

README.md

Testrunner

Usage

Command syntax:

testrunner [options] path

The runner will look recursively for all *.test files at given path.

Test file options

The test files follow the configuration file syntax (similar as .ini), see also nim parsecfg module.

Required

  • program: A test file should have at minimum a program name. This is the name of the nim source minus the .nim extension.

Optional

  • max_size: To check the maximum size of the binary, in bytes.
  • timestamp_peg: If you don't want to use the default timestamps, you can define your own timestamp peg here.
  • compile_error: When expecting a compilation failure, the error message that should be expected.
  • error_file: When expecting a compilation failure, the source file where the error should occur.
  • os: Space and/or comma separated list of operating systems for which the test should be run. Defaults to "linux, macosx, windows". Tests meant for a different OS than the host will be marked as SKIPPED.
  • --skip: This will simply skip the test (will not be marked as failure).

Forwarded Options

Any other options or key-value pairs will be forwarded to the nim compiler.

A key-value pair will become a conditional symbol + value (-d:SYMBOL(:VAL)) for the nim compiler, e.g. for -d:chronicles_timestamps="UnixTime" the test file requires:

chronicles_timestamps="UnixTime"

If only a key is given, an empty value will be forwarded.

An option will be forwarded as is to the nim compiler, e.g. this can be added in a test file:

--opt:size

Outputs

For outputs to be compared, the output string should be set to the output name (stdout or filename) from within the "Output" section, e.g.:

[Output]
stdout="""expected stdout output"""
file.log="""expected file output"""

Triple quotes can be used for multiple lines.