No description
Find a file
Federico Ceratto aabb86b6f3
Merge pull request #2 from FedericoCeratto/ga
Add Github action
2020-03-15 19:19:44 +00:00
.github/workflows Add Github action 2020-03-15 19:18:52 +00:00
tests Initial commit 2017-02-13 01:11:48 +00:00
.gitignore Initial commit 2017-02-13 01:11:48 +00:00
.travis.yml Initial commit 2017-02-13 01:11:48 +00:00
example_fail.gif Initial commit 2017-02-13 01:11:48 +00:00
example_success.gif Initial commit 2017-02-13 01:11:48 +00:00
globbing.nim Initial commit 2017-02-13 01:11:48 +00:00
junit.nim Add JUnit support 2017-03-01 16:14:51 +00:00
junitxml.tmpl Switch to fswatch 2019-04-24 19:12:06 +01:00
LICENSE Initial commit 2017-02-13 01:11:48 +00:00
README.adoc Update readme 2020-03-15 18:49:25 +00:00
testrunner.nim Switch to fswatch 2019-04-24 19:12:06 +01:00
testrunner.nimble Switch to fswatch 2019-04-24 19:12:06 +01:00

== Test runner for Nim

image:https://circleci.com/gh/FedericoCeratto/nim-testrunner.svg?style=svg["CircleCI", link="https://circleci.com/gh/FedericoCeratto/nim-testrunner"]
image:https://img.shields.io/badge/status-beta-orange.svg[badge]
image:https://img.shields.io/github/tag/FedericoCeratto/nim-testrunner.svg[tags]
image:https://img.shields.io/badge/License-GPL%20v3-blue.svg[License]

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 testrunner:

[source,bash]
----
nimble install testrunner
----

Install fswatch library (OS-dependent) or build with testrunner using -d:nofswatch to disable fswatch support

[source,bash]
----
# Debian and derivatives
sudo apt-get install libfswatch11

# MacPorts
port install fswatch

# Homebrew
brew install fswatch
----

=== Output examples

.Success
image::example_success.gif[Success]

'''

.Failure
image::example_fail.gif[Success]

'''

Contributions are welcome.