Nim/tests
Arne Döring b80dbdb77d Fix vm signed xor (#10519)
* fix #10482

* undo changes

* fix for bitwise not

* remove dead opcode
2019-02-01 12:12:10 +01:00
..
actiontable
alias
ambsym
arithm
array close #3899 by adding test case (#10424) 2019-01-23 08:44:19 +01:00
assert
assign
astoverload
async Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
bind Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
borrow
casestmt
ccgbugs properly deprecate parseopt2 (#10452) 2019-01-25 13:13:55 +01:00
clearmsg
closure Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
cnstseq
collections add isNamedTuple; make $(1, 2) be (1, 2) instead of (Field0: 1, Field1: 2) which leaked implementation detail (#10070) 2019-01-08 18:37:25 -08:00
compiler improve formatting in assertEquals 2019-01-14 17:00:54 -08:00
compilerapi
compiles
concat
concepts
constr
constraints
constructors
controlflow
converter
coroutines
cpp Properly wrap discarded statements (#10322) 2019-01-17 07:55:29 +01:00
defaultprocparam
deprecated fix #8063 by adding a testcase for: Deprecation warnings for enum values print twice (#10508) 2019-01-31 11:44:11 +01:00
deps
destructor isLastRead regression fix (#10463) 2019-01-28 08:32:14 +01:00
dir with space fixes #10042 (allow spaces in import) (#10504) 2019-01-31 08:20:00 +01:00
discard fix off by 1 error in col shown by toFileLineCol (#10138) 2018-12-31 15:42:01 +01:00
distinct
dll
effects Fix exception tracking in try blocks (#10455) 2019-01-27 10:32:44 +01:00
enum Deprecated pragma is now supported on enum fields (#10113) 2018-12-30 09:43:59 +01:00
errmsgs closes #8610 ; adds test case (#10454) 2019-01-25 19:28:03 +01:00
exception Fix semantic analysis with noReturn proc in tail pos (#10422) 2019-01-23 07:30:49 +01:00
exprs
fields
flags
float fix #10305 nim cpp is now nan-correct at CT (#10310) 2019-01-15 14:50:28 +01:00
fragmentation
friends
gc ported havlak and gcbench benchmarks to work with --gc:regions 2019-01-19 12:48:39 +01:00
generics Fix for issue #10342. better message for generic subclass instantiation (#10354) 2019-01-22 17:05:26 -08:00
gensym
global
implicit
import_in_config
init
iter disable one more test for C++ 2019-01-15 10:02:09 +01:00
js Fixes 10202 (#10283) 2019-01-12 19:49:31 +01:00
lent
let
lexer
lookups
macros fix #10339 by returning type attached to nkEmpty (#10370) 2019-01-23 11:17:32 +01:00
magics
manyloc Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
metatype make tests green again 2019-01-14 20:11:33 +01:00
method fix off by 1 error in col shown by toFileLineCol (#10138) 2018-12-31 15:42:01 +01:00
misc gc: destructors is beginning to work (#10483) 2019-01-29 15:12:16 +01:00
modules fix off by 1 error in col shown by toFileLineCol (#10138) 2018-12-31 15:42:01 +01:00
namedparams
newconfig
nimble
niminaction fix sdl_test test that failed in CI cpp mode (#10314) 2019-01-15 15:17:52 -08:00
notnil
objects disable one more test for C++ 2019-01-16 21:19:51 +01:00
objvariant fixes #10033 [backport] 2018-12-22 18:39:20 +01:00
openarray
osproc make tests green again 2018-12-11 21:23:26 +01:00
overflw
overload fixes #9149 [backport] 2019-01-29 14:31:43 +01:00
package_level_objects
parallel remove tdont_be_stupid, fixes #10386 2019-01-23 09:19:42 +01:00
parser gc: destructors is beginning to work (#10483) 2019-01-29 15:12:16 +01:00
pragmas Fixed getCustomPragmaVal to allow multiple fields in custom annotations (#10289) 2019-01-18 09:04:12 +01:00
proc typed/untyped return type is invalid for everything except templates and macros (#10275) 2019-01-15 08:08:12 +01:00
procvar
range
rational
realtimeGC
rodfiles
seq
sets
showoff
specialops
statictypes fix #10339 by returning type attached to nkEmpty (#10370) 2019-01-23 11:17:32 +01:00
stdlib move tests from tospaths to tos, fixes #9671 2019-01-23 22:04:00 +01:00
system properly deprecate parseopt2 (#10452) 2019-01-25 13:13:55 +01:00
template
testament lots of testament bug fixes and improvements: (#10044) 2018-12-20 11:49:32 +01:00
testdata
threads remove deprecated modules (#10215) 2019-01-07 10:37:49 +01:00
trmacros fixes #7524 2019-01-14 12:15:40 +01:00
tuples remove deprecated modules (#10215) 2019-01-07 10:37:49 +01:00
typerel Restrict ptr/ref to ptr/ref implicit conversion (#10411) 2019-01-22 11:17:20 +01:00
types Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
untestable
usingstmt
varres
varstmt
vm Fix vm signed xor (#10519) 2019-02-01 12:12:10 +01:00
dummy.txt
js.html
js.nim
mmaptest.nim
nim.cfg fixes #10273 execShellCmd now returns nonzero when child killed with signal + other fixes (#10274) 2019-01-13 09:00:39 +01:00
readme.md
rectest.nim
stckovfl.nim
test_nimscript.nims remove subexes 2019-01-10 09:17:12 +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.