Nim/tests
Jason Beetham 8d5a275189
Fixed distinct composite type class proc borrowing (#18904)
* Fixed composite type class proc borrowing

* Moved borrow search into transf

* added borrow check to symbol flag
2021-10-26 11:29:07 +02: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 close #17319; add testcase (#18934) 2021-10-01 16:19:02 +08:00
arithm JS: fix div uint64 no truncation (#16899) 2021-02-15 14:22:46 +01:00
array fixes #18643 [backport:1.0] (#18678) 2021-08-12 08:25:11 +02: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 fix deprecated example (#18721) 2021-08-21 08:22:00 +02:00
async fixes #18858 [backport] (#18868) 2021-09-19 23:35:50 +02:00
avr ensure the avr example keeps compiling (#17663) 2021-04-07 13:40:57 +02: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 Fixed distinct composite type class proc borrowing (#18904) 2021-10-26 11:29:07 +02:00
casestmt nnkArglist => nnkArgList + special case stylecheck:error (#17529) 2021-03-27 10:28:11 +01:00
ccgbugs fix #10128 (#18852) 2021-09-14 19:40:42 +02: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 rename nimEnableHashRef [backport] (#18941) 2021-10-04 21:28:13 +02:00
compilepragma fixes #10299 (#11324) 2019-05-25 07:33:33 +02:00
compiler Add changes required by Nimble lock file support (#12104) 2021-07-15 22:13:01 +02:00
compilerapi big steps torwards an efficient, simple IC implementation (#16543) 2021-01-02 07:30:39 +01:00
compilerfeatures fix #16693: testament spec nimout too lax (#16698) 2021-04-04 13:47:28 -07:00
compiles fix #18578 (#18580) 2021-07-27 07:21:39 +02:00
concat
concepts Make error message for empty new-styled concept more descriptive (#18506) 2021-07-18 10:49:03 +02: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 Fixed generic distinct conversions for 'var' (#18837) 2021-10-26 11:27:11 +02:00
coroutines fix #15628 (#16387) 2021-01-21 17:31:47 +01:00
cpp refs #18011 disable some newly failing tests on cpp windows; refs #17946 increase timeout for tchannels (#18012) 2021-05-14 15:33:17 -07:00
defaultprocparam Add testcase for #12252 (#15676) 2020-10-22 12:51:03 +02:00
deprecated even lighter version of #17938: fix most issues with UnusedImport, XDeclaredButNotUsed, etc; fix #17511, #17510, #14246 (without realModule) (#18362) 2021-06-26 15:21:46 +02:00
destructor Remove tracking of environment from osenv.nim v2 (#18575) 2021-07-29 23:05:26 +02: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 Fixed generic distinct conversions for 'var' (#18837) 2021-10-26 11:27:11 +02:00
distros fix tdistros test which was failing on Nightlies 2020-04-28 15:59:32 +02:00
dll don't use {.rtl.} for generics, otherwise -d:useNimRtl gives ambiguous identifier nimrtl error (#18406) 2021-07-01 11:14:01 +02:00
effects Fixed strictFuncs support for std/pegs (#18951) 2021-10-07 12:16:58 +02:00
enum fixes a regression caused by overloadable enums even though they're opt-in (#18970) 2021-10-07 15:07:24 +02:00
errmsgs asynchttpserver: ipv6 support (#18706) 2021-08-18 14:25:25 +02:00
exception fix #18620 (#18624) 2021-08-01 11:19:43 +02:00
exprs fix #16693: testament spec nimout too lax (#16698) 2021-04-04 13:47:28 -07:00
fields use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
float rename nimFpRoundtrips => nimPreviewFloatRoundtrip (#18566) 2021-07-23 14:57:47 -07:00
fragmentation tests: disable flaky tests for now; closes #9421 2018-10-18 12:12:15 +02:00
friends
gc Raise IndexDefect when deleting element at out of bounds index (#17821) 2021-06-20 08:56:33 -07:00
generics Alternative to #18928 (#18931) 2021-09-30 16:55:43 +02: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 exposes typedesc implementation shenanigans (#17759) 2021-04-18 07:27:03 +02:00
implicit lots of small changes 2018-12-11 21:23:22 +01:00
import_in_config
importalls typo: nonexistant => nonexistent (#17918) 2021-05-02 00:26:41 +02:00
init close #17636 (#17643) 2021-04-06 16:20:01 +02:00
isolate fixes #18326 (#18335) 2021-06-23 23:31:17 +02:00
iter '[]' can now be used for iterators (#18814) 2021-09-06 15:30:49 +02:00
js envPairs works in vm, nims (#18615) 2021-09-29 09:32:39 +02:00
lent fix #16898 #17621 (#17628) 2021-04-06 18:01:54 +02:00
let Allow let to not have value when using importc (#14258) 2020-05-12 20:28:18 +02:00
lexer unicode operator bugfixes (#18802) 2021-09-04 17:49:27 +02: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 fixes #14511 [backport:1.4] (#18732) 2021-08-25 17:27:00 +00:00
magics add testcase for #6499 #12229 #7172 (#18547) 2021-07-21 09:47:06 +02:00
manyloc fix #17952: fix both false positives and false negatives for reInvalidSpec (#17956) 2021-05-08 00:22:21 +02:00
metatype enable tests for #2710 (#18961) 2021-10-06 09:42:35 +02:00
method fix #16516 method dispatch for sink args (#16594) 2021-01-06 10:47:03 +00:00
misc fix RFC #341: dot-like operators are now parsed with same precedence as . (#18711) 2021-08-25 06:50:40 +02:00
modules even lighter version of #17938: fix most issues with UnusedImport, XDeclaredButNotUsed, etc; fix #17511, #17510, #14246 (without realModule) (#18362) 2021-06-26 15:21:46 +02:00
namedparams fixes #12196 2019-09-16 12:12:44 +02:00
navigator IC navigator: added support for include files (#17784) 2021-04-19 22:37:09 +02:00
newconfig config system: special case -d:release and -d:danger [backport:1.4] (#18051) 2021-05-20 11:52:46 +02:00
nimble testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
nimdoc fix #16993, #18054, #17835 runnableExamples now works with templates and nested templates (#18082) 2021-06-02 09:02:14 -07:00
niminaction use lowercase --define switches (#17283) 2021-03-07 12:08:41 +01:00
notnil add testcase for #9466 (#17538) 2021-03-28 00:57:22 -07:00
objects fixes #17437 - crash where error reporting > 1 (#17547) 2021-03-29 12:48:00 +02:00
objvariant implements https://github.com/nim-lang/RFCs/issues/407 (#18793) 2021-09-03 21:52:24 +02:00
openarray fix #12521(type alias for openArray) (#17593) 2021-04-19 11:21:35 +02:00
osproc fixes #18058 (#18162) 2021-06-03 17:12:45 +02:00
overflw Fix #15706 (#15846) 2020-11-07 08:00:41 +00:00
overload fixes #16325 [backport:1.4] (#18784) 2021-09-02 17:15:11 +02:00
package_level_objects
parallel add colon (#17834) 2021-04-24 18:33:29 +01:00
parser fixes #18847 [backport] (#18870) 2021-09-20 09:09:53 +02:00
pragmas Removes deprecated {.injectStmt.}. Fixes #18666 (#18984) 2021-10-13 11:09:45 +02:00
proc fix #18113 (#18124) 2021-05-31 13:27:44 +02:00
procvar Merge tests into a larger file (part 5 of ∞) (#9368) 2018-10-16 10:50:10 +02:00
range change --hint[X] => --hint:X in nim repo (avoids shell quoting issues) (#18085) 2021-05-26 09:51:48 +02:00
rational Error -> Defect for defects (#13908) 2020-04-28 19:56:01 +02:00
realtimeGC testament: remove deadcode related to realtimeGC, testC, callCCompiler (#18087) 2021-05-26 11:49:01 -07:00
sandwich fixes #11225; generic sandwich problems; [backport:1.2] (#17255) 2021-03-09 20:19:24 +01:00
sets close #16123 std/sets with closures in cpp (#17921) 2021-05-03 07:07:31 +02: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 even lighter version of #17938: fix most issues with UnusedImport, XDeclaredButNotUsed, etc; fix #17511, #17510, #14246 (without realModule) (#18362) 2021-06-26 15:21:46 +02:00
stdlib Add Zephyr Support (#19003) 2021-10-24 11:51:57 +02: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
stylecheck fix #17960: honor matrix also for action: compile, action: reject (#17980) 2021-05-09 09:50:08 +02:00
system remove exception (#18906) 2021-10-22 12:15:08 +02:00
template improve several tests in testament (#18635) 2021-08-08 19:28:49 +02:00
testament testament :show duration also for failed tests; improve tshould_not_work; mitigate #17946 tchannels timeouts (#17947) 2021-05-08 17:13:47 +02:00
testdata
threads add testcase for #6499 #12229 #7172 (#18547) 2021-07-21 09:47:06 +02:00
tools change --hint[X] => --hint:X in nim repo (avoids shell quoting issues) (#18085) 2021-05-26 09:51:48 +02:00
trmacros Reenable a few tests 2020-07-14 19:50:42 +02:00
tuples Fixed const tuples in inferred generics (#18598) 2021-07-27 09:36:59 +02:00
typerel typo: nonexistant => nonexistent (#17918) 2021-05-02 00:26:41 +02:00
types typo: nonexistant => nonexistent (#17918) 2021-05-02 00:26:41 +02:00
untestable try to fix broken ssl test (#18991) 2021-10-14 09:56:58 +02: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 close #17636 (#17643) 2021-04-06 16:20:01 +02:00
varstmt Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
views fixes 'lent T' inside object constructor [backport] (#18911) 2021-09-27 22:23:31 +02:00
vm followup #18453 (#18582) 2021-07-25 12:55:33 -07:00
whenstmt when statements branches exit early (#17143) 2021-02-22 12:27:23 +01:00
ast_pattern_matching.nim unify tuple expressions (#13793) 2021-03-30 02:06:51 +02:00
config.nims rename nimEnableHashRef [backport] (#18941) 2021-10-04 21:28:13 +02: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 testament: remove deadcode related to realtimeGC, testC, callCCompiler (#18087) 2021-05-26 11:49:01 -07:00
rectest.nim
stckovfl.nim
test_nimscript.nims envPairs works in vm, nims (#18615) 2021-09-29 09:32:39 +02: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.