nim-chronicles/tests
Zahary Karadjov e33a4e4195 Reorder the fields in the json output for better readability; Support using File outputs when using threads 2019-03-25 16:03:34 +02:00
..
colors use process id when thread id is not available (#43) 2019-01-24 17:31:49 -06:00
customization Reorder the fields in the json output for better readability; Support using File outputs when using threads 2019-03-25 16:03:34 +02:00
loglevel use process id when thread id is not available (#43) 2019-01-24 17:31:49 -06:00
logscope use process id when thread id is not available (#43) 2019-01-24 17:31:49 -06:00
other Cherry pick the best parts of #45 2019-03-24 23:58:02 +02:00
perf use process id when thread id is not available (#43) 2019-01-24 17:31:49 -06:00
rt_filtering Cherry pick the best parts of #45 2019-03-24 23:58:02 +02:00
sinks Reorder the fields in the json output for better readability; Support using File outputs when using threads 2019-03-25 16:03:34 +02:00
streams Reorder the fields in the json output for better readability; Support using File outputs when using threads 2019-03-25 16:03:34 +02:00
timestamps use process id when thread id is not available (#43) 2019-01-24 17:31:49 -06:00
topics use process id when thread id is not available (#43) 2019-01-24 17:31:49 -06:00
README.md Update/correct documentation 2018-11-04 12:25:47 +02:00
custom_formatters.nim Minimal patch solving the GC safety issues 2019-03-24 23:57:54 +02:00
custom_formatters_types.nim Custom formatting and auto-expanding for user-defined types 2019-03-24 22:16:04 +02:00
custom_stream.nim fix the tests involving custom streams 2018-10-19 20:01:26 +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 Fix the run-time filtering logic for the new per-topic log level 2018-11-10 15:02:13 +02:00
runtime_filtering_no_scopes.nim Cherry pick the best parts of #45 2019-03-24 23:58:02 +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 optimize the size of the generated code 2018-11-10 17:14:25 +02:00
test_config.nim Minimal patch solving the GC safety issues 2019-03-24 23:57:54 +02:00
test_helpers.nim Custom formatting and auto-expanding for user-defined types 2019-03-24 22:16:04 +02:00
testrunner.nim Minimal patch solving the GC safety issues 2019-03-24 23:57:54 +02:00
topics_and_loglvls.nim #20 Add first set of tests 2018-10-15 16:45:27 +02:00
xml_stream.nim fix compilation with Nim HEAD 2018-12-22 15:44:52 +02: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
Run the test(s) specified at path. Will search recursively for test files
provided path is a directory.
Options:
--targets:"c c++ js objc" [Not implemented] Run tests for specified targets
--include:"test1 test2"   Run only listed tests (space/comma seperated)
--exclude:"test1 test2"   Skip listed tests (space/comma seperated)
--help                    Display this help and exit

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.