Nim/tests
Sivchari fb32fff8dc
js generates spurious >>> on shr (#17767)
* js generates spurious >>> on shr
* Add shr arithmetic test
* fix variables from const to let during testing
2021-04-21 19:47:01 +02:00
..
actiontable
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
arc Fix #17199 (#17348) 2021-03-26 13:05:51 +01:00
arithm JS: fix div uint64 no truncation (#16899) 2021-02-15 14:22:46 +01:00
array Fix array's high & low return type for empty arrays (#17705) 2021-04-15 15:45:38 +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 unify tuple expressions (#13793) 2021-03-30 02:06:51 +02:00
async simplify asyncfutures, asyncmacro (#17633) 2021-04-14 21:22:22 +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 Add testcase for #14440 (#14771) 2020-06-23 14:17:12 +02:00
casestmt nnkArglist => nnkArgList + special case stylecheck:error (#17529) 2021-03-27 10:28:11 +01:00
ccgbugs type with same name in different scope now works (#17710) 2021-04-14 08:50:15 +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
closure use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
cnstseq
collections fix https://github.com/nim-lang/RFCs/issues/311 remove unary slice (#16714) 2021-04-19 19:02:52 -07:00
compilepragma fixes #10299 (#11324) 2019-05-25 07:33:33 +02:00
compiler close #12684 add testcase (#17599) 2021-03-31 20:55:27 +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 delete list comprehension (#12392) 2019-11-22 19:57:43 +01:00
concat
concepts close #17636 (#17643) 2021-04-06 16:20:01 +02:00
constr semLambda removed, semProcAux reworked (#17379) 2021-03-17 19:51:50 +01:00
constraints
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 close #17636 (#17643) 2021-04-06 16:20:01 +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 fix #12282 distinct now does not create erroneous copy in VM (#17594) 2021-03-31 10:15:08 +02: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 close #17636 (#17643) 2021-04-06 16:20:01 +02:00
enum type with same name in different scope now works (#17710) 2021-04-14 08:50:15 +02:00
errmsgs fix CI tests/errmsgs/tgcsafety.nim (#17721) 2021-04-14 13:45:25 -07:00
exception Make 'echo' raise IOErrors when appropriate (#16367) 2020-12-18 10:06:13 +01: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
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
friends
gc [os:standalone]fix #14011 (#17564) 2021-03-29 17:54:28 +02: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
ic IC exposes typedesc implementation shenanigans (#17759) 2021-04-18 07:27:03 +02:00
implicit
import_in_config
importalls privateAccess now works with ref | ptr (#17760) 2021-04-19 00:15:58 +02:00
init close #17636 (#17643) 2021-04-06 16:20:01 +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 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 unify tuple expressions (#13793) 2021-03-30 02:06:51 +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 close #7875 add testcase (#17611) 2021-04-02 11:56:30 +02: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 unit separator (#17730) 2021-04-20 16:30:17 +02: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
navigator IC navigator: added support for include files (#17784) 2021-04-19 22:37:09 +02:00
newconfig fix #17190 nimscript now accepts arbitrary file extensions for nim e main.customext (#17596) 2021-04-01 08:05:04 +02:00
nimble testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
nimdoc fix #17615(runnableExamples silently ignored if placed after some code) (#17619) 2021-04-02 18:26:30 -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 close #17636 (#17643) 2021-04-06 16:20:01 +02:00
openarray fix #12521(type alias for openArray) (#17593) 2021-04-19 11:21:35 +02:00
osproc unit separator (#17730) 2021-04-20 16:30:17 +02: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 fix #7535(Poor error message for spawn when a procedure (without calling it)) (#17774) 2021-04-21 17:53:31 +02:00
parser refs #15667 improve invalid indentation errors, report when & where = could be missing (#16397) 2021-04-10 08:55:39 +02:00
pragmas getCustomPragmaVal priority/override fixes (#17725) 2021-04-21 15:28:42 +02:00
proc close #17157 add testcase (#17531) 2021-03-27 01:51:57 -07:00
procvar
range fix range to unsigned conversion (#17754) 2021-04-17 15:34:00 +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 follow up #17536 (#17727) 2021-04-15 19:25:03 +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 fix #14585, fix #17589: access to static param now works (#17590) 2021-03-31 11:25:26 +02:00
stdlib js generates spurious >>> on shr (#17767) 2021-04-21 19:47:01 +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
system fix #17749 ignore SIGPIPE signals, fix nim CI #17748 (#17752) 2021-04-18 15:34:29 +02:00
template close #9534 add testcase (#17607) 2021-04-01 08:47:59 +02:00
testament megatest: allow duplicate file names, show compilation progress (#17713) 2021-04-13 23:16:19 +02:00
testdata
threads fix #17267 (#17273) 2021-03-07 12:13:41 +01:00
tools close #14806 (#17626) 2021-04-03 08:17:55 +02:00
trmacros Reenable a few tests 2020-07-14 19:50:42 +02:00
tuples close #7012 add testcase (#17537) 2021-03-27 10:12:11 -07:00
typerel typeToString: type float => typedesc[float] (#17011) 2021-02-12 17:10:20 +01:00
types iterable[T] (#17196) 2021-04-11 14:25:41 +02:00
untestable [nim-gdb] Fixed enums and flag output [ci skip] (#17634) 2021-04-05 11:37:28 +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
views close #17636 (#17643) 2021-04-06 16:20:01 +02:00
vm follow up #17518 (#17726) 2021-04-15 19:25:35 +02: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 --filenames:abs|canonical|legacyRelProj for filenames in compiler msgs (replaces --listfullpaths:on|off) (#17746) 2021-04-21 15:26:27 +02:00
dummy.txt
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.