Nim/tests
Andreas Rumpf 86af2f7b50
make unary minus part of number literals, refs #17020 (#17488)
* make unary minus part of number literals, refs #17020
* fixes regression
2021-03-24 09:47:11 +01:00
..
actiontable Merge tests into a larger file (part 1 of ∞) (#9318) 2018-10-12 17:02:46 +02:00
alias
align testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY (#16343) 2020-12-14 10:58:29 +01:00
ambsym require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
arc Fixes #17450 (#17477) 2021-03-23 16:30:49 +01:00
arithm JS: fix div uint64 no truncation (#16899) 2021-02-15 14:22:46 +01:00
array typeToString: type float => typedesc[float] (#17011) 2021-02-12 17:10:20 +01:00
assert Improve documentation for assertions (#16988) 2021-02-11 07:21:27 +01:00
assign use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
astoverload
astspec styleCheck: Fix error for sugar and std/with (#16176) 2020-12-02 20:48:16 +01:00
async use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
benchmarks fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750) 2021-01-27 22:35:43 +01:00
bind typeToString: type float => typedesc[float] (#17011) 2021-02-12 17:10:20 +01:00
borrow Add testcase for #14440 (#14771) 2020-06-23 14:17:12 +02:00
casestmt nimout now consistently uses nimoutCheck (#16189) 2020-12-01 21:12:40 +01:00
ccgbugs Fix #14325 (#17308) 2021-03-11 14:03:25 +01:00
ccgbugs2 testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY (#16343) 2020-12-14 10:58:29 +01:00
clearmsg require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
closure use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
cnstseq require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
collections use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
compilepragma fixes #10299 (#11324) 2019-05-25 07:33:33 +02:00
compiler testament: support disabled:osx as alias to disabled:macosx (#17124) 2021-02-22 11:01:15 +01:00
compilerapi big steps torwards an efficient, simple IC implementation (#16543) 2021-01-02 07:30:39 +01:00
compilerfeatures new compiler feature: --expandMacro 2019-05-29 20:47:28 +02:00
compiles delete list comprehension (#12392) 2019-11-22 19:57:43 +01:00
concat
concepts new-style concepts implementation, WIP (#15251) 2021-02-24 13:17:33 +01:00
constr semLambda removed, semProcAux reworked (#17379) 2021-03-17 19:51:50 +01:00
constraints require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
constructors Turn some of the errors back into warnings 2020-04-01 19:38:44 +02:00
controlflow Make unreachable code a warning instead of an error (#14816) 2020-06-29 08:49:53 +02:00
converter semLambda removed, semProcAux reworked (#17379) 2021-03-17 19:51:50 +01:00
coroutines fix #15628 (#16387) 2021-01-21 17:31:47 +01:00
cpp --nilseqs is now a deprecated noop (#17211) 2021-03-01 20:59:43 +01:00
defaultprocparam Add testcase for #12252 (#15676) 2020-10-22 12:51:03 +02:00
deprecated fix #11009 (#14935) 2020-07-09 09:57:35 +02:00
destructor Fixes #17450 (#17477) 2021-03-23 16:30:49 +01:00
dir with space fixes #10042 (allow spaces in import) (#10504) 2019-01-31 08:20:00 +01:00
discard improve the 'has to be discarded' error message 2020-05-02 22:31:19 +02:00
distinct fix #13517 (#16681) 2021-01-11 15:07:48 +01:00
distros fix tdistros test which was failing on Nightlies 2020-04-28 15:59:32 +02:00
dll IC: green tests (#17311) 2021-03-19 16:53:38 +01:00
effects strictFuncs+views: add test that imports stdlib modules (#16878) 2021-02-03 16:00:29 +01:00
enum fix #15145 (#15816) 2020-11-02 08:56:51 +01:00
errmsgs fixed dot operator recursive loop & macro suggest (#16922) 2021-02-15 09:51:05 +01:00
exception Make 'echo' raise IOErrors when appropriate (#16367) 2020-12-18 10:06:13 +01:00
exprs update tests that tested for the 'discard' error messages 2020-05-02 22:31:19 +02:00
fields use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
flags testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY (#16343) 2020-12-14 10:58:29 +01:00
float fix #16469 vm float constants: do not conflate -0.0 and 0.0 (#16470) 2020-12-27 14:35:01 +01:00
fragmentation tests: disable flaky tests for now; closes #9421 2018-10-18 12:12:15 +02:00
friends
gc fixes #17085 [backport:1.2] (#17101) 2021-02-19 12:30:39 +01:00
generics semLambda removed, semProcAux reworked (#17379) 2021-03-17 19:51:50 +01:00
gensym fixes yet another gensym regression (#12145) 2019-09-06 00:45:00 +02:00
global require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
ic IC: green tests (#17311) 2021-03-19 16:53:38 +01:00
implicit lots of small changes 2018-12-11 21:23:22 +01:00
import_in_config
init init checks and 'out' parameters (#14521) 2020-06-23 10:53:57 +02:00
isolate 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011) 2020-07-20 07:50:19 +02:00
iter follow up #17486 (#17492) 2021-03-24 08:49:05 +01:00
js followup #16871 asyncjs.then: allow pipelining procs returning futures (#17189) 2021-03-04 14:00:04 +01:00
lent testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
let Allow let to not have value when using importc (#14258) 2020-05-12 20:28:18 +02:00
lexer make unary minus part of number literals, refs #17020 (#17488) 2021-03-24 09:47:11 +01:00
lookups make megatest consistent with unjoined tests wrt newlines, honor newlines in output spec (#16151) 2020-11-28 09:09:31 +01:00
macros Remove support for named procs with sugar.=> (#17220) 2021-03-05 12:08:03 +01:00
magics make megatest consistent with unjoined tests wrt newlines, honor newlines in output spec (#16151) 2020-11-28 09:09:31 +01:00
manyloc use lowercase --define switches (#17283) 2021-03-07 12:08:41 +01:00
metatype typeToString: type float => typedesc[float] (#17011) 2021-02-12 17:10:20 +01:00
method fix #16516 method dispatch for sink args (#16594) 2021-01-06 10:47:03 +00:00
misc Close #8545 by add a test case (#17432) 2021-03-20 18:30:57 -07:00
modules refactorings to prepare the compiler for IC (#15935) 2020-12-17 08:01:36 +01:00
namedparams fixes #12196 2019-09-16 12:12:44 +02:00
newconfig fix #16526 run config.nims before foo.nim.cfg (#16557) 2021-01-02 21:41:44 +01:00
nimble testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
nimdoc fix #13491 #17279 runnableExamples now don't get lost in translation (#17282) 2021-03-09 07:09:24 +01:00
niminaction use lowercase --define switches (#17283) 2021-03-07 12:08:41 +01:00
notnil Add tests for #8481, #6490 and #4061 (#14083) 2020-04-23 19:52:33 +02:00
objects remove some noises in tests (#16448) 2020-12-27 14:45:57 +01:00
objvariant close #14581 add testcase (#17169) 2021-02-24 13:49:47 +01:00
openarray followup #17001: improve coverage for tests/openarray/topenarray.nim (#17006) 2021-02-13 09:33:42 +01:00
osproc use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
overflw Fix #15706 (#15846) 2020-11-07 08:00:41 +00:00
overload make megatest consistent with unjoined tests wrt newlines, honor newlines in output spec (#16151) 2020-11-28 09:09:31 +01:00
package_level_objects
parallel IC: green tests (#17311) 2021-03-19 16:53:38 +01:00
parser add finally as post expr block [backport:1.4] (#16896) 2021-02-01 20:14:20 +01:00
pragmas disable hint:processing in tests (#16713) 2021-01-14 10:19:20 +01:00
proc Remove declPragmas from lambdas [backport:1.0] (#16966) 2021-02-09 14:23:06 +01:00
procvar Merge tests into a larger file (part 5 of ∞) (#9368) 2018-10-16 10:50:10 +02:00
range Error -> Defect for defects (#13908) 2020-04-28 19:56:01 +02:00
rational Error -> Defect for defects (#13908) 2020-04-28 19:56:01 +02:00
realtimeGC fixed article duplication typos (#16216) 2020-12-02 09:15:29 +01:00
sandwich fixes #11225; generic sandwich problems; [backport:1.2] (#17255) 2021-03-09 20:19:24 +01:00
sets fix #17385, len must be declared before items (#17386) 2021-03-15 10:45:10 -07:00
showoff Clean up macros (#14959) 2020-07-14 16:44:56 +02:00
specialops tests and docs for call operator (#16980) 2021-02-09 12:18:16 +01:00
statictypes semLambda removed, semProcAux reworked (#17379) 2021-03-17 19:51:50 +01:00
stdlib [isolation]fix empty ref object bug (#17471) 2021-03-24 09:44:24 +01:00
stmt fix #15972 (#15994) 2020-11-18 00:14:14 +00:00
strictnotnil Nil type check implementation (#15287) 2020-12-29 10:31:11 +01:00
system Ref #12700 add testcase (#17096) 2021-02-19 14:09:12 +01:00
template semTemplateDef and t17433 clean-ups (#17448) 2021-03-22 12:46:34 +01:00
testament fix testament regression: installed testament works again with testament r path (#16767) 2021-01-20 14:04:08 +01:00
testdata
threads fix #17267 (#17273) 2021-03-07 12:13:41 +01:00
tools new feature: --staticBoundChecks:on to enforce static array index checking (#10965) 2020-03-18 14:25:10 +01:00
trmacros Reenable a few tests 2020-07-14 19:50:42 +02:00
tuples tests/tuples/ttuples_issues.nim: test on all backends + various improvements (#16907) 2021-02-02 20:17:13 +01:00
typerel typeToString: type float => typedesc[float] (#17011) 2021-02-12 17:10:20 +01:00
types use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
untestable refs #16338 make thttpclient_ssl_remotenetwork.nim less flaky (#17457) 2021-03-23 08:30:41 +01:00
usingstmt Clean up macros (#14959) 2020-07-14 16:44:56 +02:00
valgrind testament: support disabled:osx as alias to disabled:macosx (#17124) 2021-02-22 11:01:15 +01:00
varres testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
varstmt Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
views ensure the Nim compiler works with --experimental:strictFuncs --experimental:views [backport:1.4] (#15737) 2020-10-26 21:08:57 +01:00
vm add overload add(a: var string, b: openArray[char]) (#15951) 2021-03-01 07:51:12 -08:00
whenstmt when statements branches exit early (#17143) 2021-02-22 12:27:23 +01:00
ast_pattern_matching.nim add tastspec (and ast_pattern_matching) (#10863) 2019-03-19 11:45:29 +01:00
config.nims followup #16067 --spellSuggest (#17401) 2021-03-17 07:40:29 +01:00
dummy.txt Remove install.txt and readme.txt (#9521) 2018-10-28 13:36:52 +01:00
js.html
js.nim
m14634.nim use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
mmaptest.nim Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
readme.md Update link to parseSpec proc 2020-06-28 00:13:54 +02:00
rectest.nim
stckovfl.nim
test_nimscript.nims Make parseopt available on all backends (#17009) 2021-02-13 09:05:40 +01:00

This directory contains the test cases.

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

Note: Testament is only aware of tests under a directory (eg tests/foo/) and will ignore top-level tests like tests/tbar.nim.

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

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 pcat <category> (or cat to avoid parallel testing, which is slower).

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.