Nim/tests
Dennis Felsing 5492190bc6 Fix lists of paths in posix environment (#7034)
Empty paths in a colon separated list would be considered as the current
directory, so have to ensure $PATH and $LD_LIBRARY_PATH are not empty
before separating it with :
2018-01-08 10:49:00 +01:00
..
actiontable tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
alias Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
ambsym tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
arithm breaking change: 'and' and 'mod' do not produce a subrange type anymore; fixes #5854 2017-10-30 00:27:30 +01:00
array Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
assert Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
assign tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
astoverload new tester; all tests categorized 2014-01-13 02:10:03 +01:00
async Simplify async traceback processing. 2017-12-28 09:21:22 +01:00
benchmarks tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
bind Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
borrow tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
caas Rename PNimrodNode to NimNode 2015-03-17 17:50:32 +01:00
casestmt Implement language feature #6885 (#6954) 2017-12-24 22:22:03 +01:00
ccgbugs fixes #668 2017-12-15 11:21:49 +01:00
clearmsg lift parameter-less do block to lambdas 2017-04-10 23:58:05 +03:00
closure bugfix: detect captures in non-closure inner procs 2017-11-03 18:05:14 +01:00
cnstseq tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
collections Fixed mutex usage in SharedList and SharedTable. Closes #6988 (#6990) 2017-12-31 09:28:51 +01:00
compiles Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
concat new tester; all tests categorized 2014-01-13 02:10:03 +01:00
concepts fix #6462 2017-12-21 11:08:45 +01:00
constr the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
constraints tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
constructors Fixes #5965 (#6237) 2017-08-14 17:43:39 +02:00
controlflow tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
converter fixes #4537 2016-08-02 14:53:21 +02:00
coroutines attempt to make travis OSX tests green and mandatory 2017-03-29 10:14:03 +02:00
cpp Alternative fix for #4910 that covers #6892; fixes #6892 (#6938) 2017-12-17 23:56:21 +01:00
defaultprocparam new tester; all tests categorized 2014-01-13 02:10:03 +01:00
deprecated fixes --gc:none regression; made some tests green 2015-03-10 12:32:47 +01:00
destructor more progress on destructors; removed old destructor based code as it proved confusing 2017-12-01 01:52:00 +01:00
dir with space tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
discard Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
distinct make tests on Windows green 2017-01-31 23:05:36 +01:00
dll tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
effects make tests green again 2017-10-15 09:32:53 +02:00
enum Fixes #5062 (#5527); JS: holes in enums 2017-03-15 10:33:37 +01:00
errmsgs added a test case for bug #6776 2017-11-18 23:15:35 +01:00
exception Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
exprs fixes #6980 2017-12-27 21:26:37 +01:00
fields Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
float Added 'lenient ops' module (#6754) 2017-11-21 13:22:27 +01:00
fragmentation make tfragment_gc more robust 2017-12-12 19:35:40 +01:00
friends tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
gc fix 2017-07-24 23:21:51 +02:00
generics Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
gensym equality check on NimSym has now support in the VM; refs #6139 2017-09-03 01:15:40 +02:00
global tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
implicit unsigned array indexes work better; minor cleanups 2015-02-10 20:19:46 +01:00
import_in_config fixes a regression that caused --import in a config file to break things 2016-08-29 11:33:41 +02:00
init tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
iter make more tests green 2017-11-01 00:56:03 +01:00
js Fix the forward test 2017-12-20 14:09:02 +02:00
let Fix tests some more 2015-03-17 00:02:47 +01:00
lexer make tests green again 2017-11-05 13:02:46 +01:00
lookups fixes #4353 2016-08-04 19:36:13 +02:00
macros modify getTypeImpl to reduce result to final implementation (#6891) 2017-12-09 13:07:37 +01:00
magics the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
manyloc Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
metatype Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
method added missing test for methods 2017-09-28 21:52:23 +02:00
misc make tests green again 2017-12-15 13:24:47 +01:00
modules fixes #6965 2017-12-28 00:50:45 +01:00
namedparams tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
newconfig fixes #6327 2017-09-05 09:03:09 +02:00
nimble Implement .nimble-link files in the compiler and add tests for them. 2017-09-02 15:28:25 +01:00
niminaction @dom96's comments: remove bountysource, revert configurator change. 2017-10-14 16:03:50 +03:00
notnil fixes #3993 2017-11-23 03:12:09 +01:00
objects Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
objvariant Add test for objvariant construction order 2017-09-09 15:45:19 -07:00
openarray fixed #2240 and #3586 2016-01-05 07:52:56 +07:00
osproc Refactored version of execProcesses with test. 2017-11-28 14:03:09 +02:00
overflw tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
overload Fix compiler crash (#6773) (#6774) 2017-11-18 09:21:37 +01:00
package_level_objects new feature: package level objects 2017-10-29 07:54:39 +01:00
parallel GC test workaround: use a lock for 'echo' for Windows 2017-12-07 13:14:28 +01:00
parser make tests green again 2017-11-19 20:09:38 +01:00
pragmas Allow noreturn procs with void type (#6973) 2017-12-27 10:09:24 +01:00
proc tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
procvar tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
range Fix typo in new test 2017-11-01 18:13:27 +03:00
rational make tests green again 2017-11-18 23:03:16 +01:00
realtimeGC tests: Trim .txt files trailing whitespace 2015-09-04 23:11:11 +02:00
rodfiles updated test case 2016-08-27 13:26:16 +02:00
seq fixes #4973 2017-02-01 12:09:24 +01:00
sets Add counterpart to containsOrIncl for excl (#6360) 2017-09-15 10:49:32 +02:00
showoff Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
specialops dotops: add a simple object delegation test 2017-12-01 02:05:48 +01:00
statictypes close #1051 2017-06-20 11:29:42 +02:00
stdlib memfiles: enable test; refs #6361 2018-01-03 13:31:03 +01:00
system Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
template Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
testament Fix lists of paths in posix environment (#7034) 2018-01-08 10:49:00 +01:00
testdata Fix for #5134 (parseJson(string) should fail on leftover data) (#5203) 2017-01-11 06:50:18 +01:00
threads the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
trmacros Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
tuples make tests green again 2017-12-15 13:24:47 +01:00
typerel Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
types Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
untestable Add comments on "untestable" tests directory 2017-11-03 20:58:32 +00:00
usingstmt Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
varres the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
varstmt tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
vm add tests for integer casting in VM. 2017-12-30 10:30:40 +01:00
benchmark.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
js.html Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
js.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
mmaptest.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
readme.md Add readme to tests. Add fileDir option to testament & create nimble test. 2017-09-02 15:03:39 +01:00
rectest.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
stckovfl.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
test_nimscript.nims bugfix: make 'macros' module available for nimscript 2017-11-14 23:26:46 +01:00

This directory contains the test cases.

Each test must have a filename of the form: t*.nim

Note: Tests are only compiled by default. In order to get the tester to execute the compiled binary, you need to specify a spec with an action key (see below for details).

Specs

Each test can contain a spec in a discard """ ... """ block.

Check out the parseSpec procedure in the specs module for a full and reliable reference

action

Specifies what action this test should take.

Default: compile

Options:

  • compile - compiles the module and fails the test if compilations fails.
  • run - compiles and runs the module, fails the test if compilation or execution of test code fails.
  • reject - compiles the module and fails the test if compilation succeeds.

There are certain spec keys that imply run, including output and outputsub.

cmd

Specifies the Nim command to use for compiling the test.

There are a number of variables that are replaced in this spec option:

  • $target - the compilation target, e.g. c.
  • $options - the options for the compiler.
  • $file - the filename of the test.
  • $filedir - the directory of the test file.

Example:

discard """
  cmd: "nim $target --nimblePath:./nimbleDir/simplePkgs $options $file"
"""

Categories

Each folder under this directory represents a test category, which can be tested by running koch tests cat <category>.

The folder rodfiles contains special tests that test incremental compilation via symbol files.

The folder dll contains simple DLL tests.

The folder realtimeGC contains a test for validating that the realtime GC can run properly without linking against the nimrtl.dll/so. It includes a C client and platform specific build files for manual compilation.