Step by step I follow this: http://nim-lang.github.io/Nim/testament.html#running-a-single-test
It's not working. I got this output:
Any Ideas for helping me?
PS K:\40-Nim\Projects> testament run test0.nim
fatal.nim(53) sysFatal
Error: unhandled exception: specialpaths.nim(49, 12) `false` file must match this pattern: '/pathto/tests/dir/**/tfile.nim', got: 'test0.nim' [AssertionDefect]
PS K:\40-Nim\Projects>
Tests for Testament have to be in separated subdirectories. My guess, the documentation needs some updates, unless it is a bug. ;)
For example, if your main tests directory is tests, and you want to have test file test0.nim you have to put it in a path like tests/subdir/test0.nim
Then run them with testament run tests/subdir/test0.nim or testament pattern tests/**/*nim to run all available tests.
Thank you! Your hint: It worked, but now the
import cmdparser is not working anymore.
Any Idea for me to help?
Got this:
PS K:\40-Nim\Projects\cmdparser> testament run tests/subdir/test1.nim
FAIL: tests/subdir/test1.nim c ( 1.13 sec)
Test "tests\subdir\test1.nim" in category "subdir"
Failure: reNimcCrash
debugInfo: compiler exit code was 0 but some Error's were found.
$ C:\Users\rtdie\.nimble\bin\nim.exe c --hints:on -d:testing --nimblePath:build/deps/pkgs --nimCache:nimcache\tests\subdir\test1.nim_4a8a08f09d37b73795649038408b5f33 tests\subdir\test1.nim
Hint: used config file 'C:\Users\rtdie\.choosenim\toolchains\nim-1.6.6\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\rtdie\.choosenim\toolchains\nim-1.6.6\config\config.nims' [Conf]
Hint: used config file 'K:\40-Nim\Projects\cmdparser\tests\config.nims' [Conf]
Hint: used config file 'K:\40-Nim\Projects\cmdparser\tests\subdir\config.nims' [Conf]
.........................................................
K:\40-Nim\Projects\cmdparser\tests\subdir\test1.nim(1, 8) Error: cannot open file: cmdparser
FAILURE! total: 1 passed: 0 skipped: 0 failed: 1
PS K:\40-Nim\Projects\cmdparser>
Thank you!