https://github.com/jyapayne/tani
A light Nim testing framework
https://github.com/jyapayne/tani
Last synced: about 2 months ago
JSON representation
A light Nim testing framework
- Host: GitHub
- URL: https://github.com/jyapayne/tani
- Owner: jyapayne
- License: mit
- Created: 2019-02-21T01:38:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T19:04:07.000Z (over 5 years ago)
- Last Synced: 2025-01-22T01:46:27.845Z (3 months ago)
- Language: Nim
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tani
A light Nim testing framework## Usage
For a directory structure like:
```
tests/
runner.nim
testThings.nim
```Simply sprinkle the `test` macro anywhere in your code and call the `runTests` macro once at the end of the module to run all tests collected in that module. You must also defined a `runner` module in the root directory that simply has the following code in it:
```nim
# runner.nim
import tanidiscoverAndRunTests()
```Compile the above with `nim c -d:test -r runner.nim`, and it will automatically find all modules in the same directory and subdirectories and run them if the modules (file names) begin with `test`.
Contents of `testThings.nim`:
```nim
# testThings.nim
import taniproc doSomething(): string =
test "test do something":
let testValue = "the value"
check doSomething() == testValuereturn "the value"
runTests()
```