testrunner

Test runner with file monitoring and desktop notification capabilities


Keywords
test, tests, unittest, utility, tdd, functional-testing, nim, nim-lang, nim-language, testing, unit-testing, unittesting
License
GPL-3.0
Install
nimble install testrunner

Documentation

Test runner for Nim

CircleCI

Welcome to Nim test runner. This tool runs the Nim compiler against a set of source files. It’s meant to compile and run unittest files but it can also be used to compile other source files.

It supports globbing and can run tests automatically when source files are changed.

Generates reports in JUnit format.

Note
File change monitoring and desktop notifications works only on Linux
Syntax:
testurunner ['test filename globbing'...] [-m [:'monitored filename globbing']] [ -- compiler flags]
testrunner 'tests/**/*.nim'
testrunner -m
testrunner -m:'*.nim' -- -p:.
testrunner mytest.nim 'tests/*.nim' -m:'**/*.nim' -d -- -d:ssl
testrunner (-h | --help)
Options:
-h --help       show help
-d --debug      debug mode
-m --monitor    without any argument, monitor **/*.nim
-m:'<glob>'     monitor globbing. Remember the colon ":"
--basedir <dir> basedir
-c --conf       config file path
--nocolor       disable color and set NIMTEST_NO_COLOR=1
-o --norun      do not run test files, run "nim c" only
-q --nonotify   do not send desktop notifications (enabled only with -m on Linux)
--junit:<fname> write out JUnit summary (default: junit.xml)

Protect globbings with single quotes.

Double asterisk matches nested subdirectories. E.g. 'tests/**/*.nim' will match Nim files under tests/ and any subdirectory.

(you might have to protect the asterisks from your shell using single quotes)

Anything after "--" will be used as a compiler option for Nim.

If no test globs are passed, the following will be used: test_*.nim test/*.nim tests/*.nim

Testrunner will also parse .testrunner.conf if available, unless a different config file is specified.

Install

nimble install testrunner

Output examples

Success
Figure 1. Success

Success
Figure 2. Failure

Contributions are welcome.