Nim/tests
konradmb addd7b5e20 Fix issue #10726 - HTTP response without Content-Length is not accessible (#11904)
* Add patch by @xenogenesi

* Async test for HTTP/1.1 without Content-Length

* Apply suggestions from code review

Co-Authored-By: Dominik Picheta <dominikpicheta@googlemail.com>
2019-08-08 08:41:56 +02:00
..
actiontable Merge tests into a larger file (part 1 of ∞) (#9318) 2018-10-12 17:02:46 +02:00
alias Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
ambsym require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
arithm int128 on firstOrd, lastOrd and lengthOrd (#11701) 2019-08-07 15:53:16 +02:00
array fixes #8316 (#11673) 2019-07-06 20:02:50 +02:00
assert assertions: fixes #11545 (#11605) 2019-07-01 13:19:07 +02:00
assign make tests green again 2019-05-27 21:29:02 +02:00
astoverload
astspec add tastspec (and ast_pattern_matching) (#10863) 2019-03-19 11:45:29 +01:00
async int128 on firstOrd, lastOrd and lengthOrd (#11701) 2019-08-07 15:53:16 +02:00
bind Remove deprecated modules (asyncio, sockets, ftpclient) (#10401) 2019-01-22 16:06:44 +01:00
borrow require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
casestmt closes #11551 (#11693) 2019-07-09 19:38:38 +02:00
ccgbugs Allow typeof(nil) as generic parameter (#11869) 2019-08-03 10:16:07 +02:00
clearmsg require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
closure fixes #11523 2019-06-26 23:41:20 +02:00
cnstseq require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
collections faster CountTable sort(), optional SortOrder (#11010) 2019-04-16 09:42:54 +02:00
compilepragma fixes #10299 (#11324) 2019-05-25 07:33:33 +02:00
compiler fixes #11194 (#11242) 2019-05-14 01:28:44 +02:00
compilerapi make tests green again 2019-05-27 21:29:02 +02:00
compilerfeatures new compiler feature: --expandMacro 2019-05-29 20:47:28 +02:00
compiles make run the default action of a test in tester 2018-11-23 11:58:28 +01:00
concat
concepts fixes #11807 (#11900) 2019-08-07 22:40:58 +02:00
constr fixes #10943 (#10947) 2019-04-05 14:50:57 +02:00
constraints require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
constructors require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
controlflow Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
converter 32 bit fixes (#10608) 2019-02-12 22:00:31 +01:00
coroutines intVal works now on enum field symbols (#11403) 2019-06-05 14:55:47 +02:00
cpp fixes #10765 (#10993) [backport] 2019-04-11 13:51:51 +02:00
defaultprocparam updated tests to be executed 2018-11-23 11:58:28 +01:00
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 testament megatest: furher refactorings making more tests green 2018-12-11 21:23:24 +01:00
destructor fixes #11807 (#11900) 2019-08-07 22:40:58 +02:00
dir with space fixes #10042 (allow spaces in import) (#10504) 2019-01-31 08:20:00 +01:00
discard revert discardable transformation (#10905) 2019-04-21 09:57:53 +02:00
distinct fixes #11715 (#11721) 2019-07-13 07:55:56 +02:00
dll make tests green again 2019-05-27 21:29:02 +02:00
effects fixes a critical GC safety inference bug (#10615) 2019-03-05 19:54:44 +01:00
enum add tests for recently closed issues (#10722) 2019-02-23 10:41:35 +01:00
errmsgs disallow static in return type (#9686) [nobackport] 2019-08-06 01:26:53 +02:00
exception fixes #11309 (#11310) 2019-05-23 19:32:44 +02:00
exprs require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
fields make tests green again 2019-05-27 21:29:02 +02:00
flags require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
float fix #10305 nim cpp is now nan-correct at CT (#10310) 2019-01-15 14:50:28 +01:00
fragmentation tests: disable flaky tests for now; closes #9421 2018-10-18 12:12:15 +02:00
friends tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
gc travis: cleanup & add 32-bit Linux testing (#11337) 2019-05-30 07:34:54 +02:00
generics fixes subtype relation regression 2019-05-22 07:41:16 +02:00
gensym equality check on NimSym has now support in the VM; refs #6139 2017-09-03 01:15:40 +02:00
global require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
ic Incremental compilation (IC): Improvements (#11881) 2019-08-08 08:41:05 +02:00
implicit lots of small changes 2018-12-11 21:23:22 +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 activated more tests, allow input in test spec 2018-11-23 11:58:28 +01:00
iter close #9827 by adding a test 2019-05-30 11:18:17 +02:00
js close #11166 by adding a test 2019-07-25 10:05:02 +02:00
lent make test green 2019-03-05 05:53:28 +01:00
let require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
lexer megatest: make it green on Linux 2018-12-11 21:23:25 +01:00
lookups Allow void macro result (#11286) 2019-05-21 21:31:40 +02:00
macros Fixes #11662: render ops priority (#11664) 2019-07-05 21:25:36 +02:00
magics run runnableExamples in the module scope (#11732) [feature] 2019-07-22 16:22:57 +02:00
manyloc Fixed #9762 (#11296) 2019-05-29 12:11:03 +02:00
metatype revert the bugfix for #11747 as it really was a new, poorly though-out feature 2019-07-19 19:32:13 +02:00
method fixes #6777 (#11347) 2019-05-28 22:00:01 +02:00
misc int128 on firstOrd, lastOrd and lengthOrd (#11701) 2019-08-07 15:53:16 +02:00
modules fixes #11188 (#11319) 2019-05-24 22:50:43 +02:00
namedparams require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
newconfig [feature] Added os.delEnv; add delEnv support to nimscript too (#11466) 2019-06-15 11:32:26 +02:00
nimble Implement .nimble-link files in the compiler and add tests for them. 2017-09-02 15:28:25 +01:00
niminaction fix sdl_test test that failed in CI cpp mode (#10314) 2019-01-15 15:17:52 -08:00
notnil require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
objects Remove immediate pragma (#11308) 2019-05-29 22:21:51 +02:00
objvariant parameter runtime discriminators (#11397) 2019-06-04 22:10:39 +02:00
openarray Fixes for ptr array deref codegen (#11191) 2019-05-07 08:14:38 +02:00
osproc make tests green again 2018-12-11 21:23:26 +01:00
overflw make fullpaths the default in error messages and stack traces for mor… (#11385) 2019-06-05 08:02:54 +02:00
overload fixes #11375 (#11376) 2019-06-02 06:33:35 +02:00
package_level_objects new feature: package level objects 2017-10-29 07:54:39 +01:00
parallel make tests green 2019-05-28 07:31:25 +02:00
parser Remove immediate pragma (#11308) 2019-05-29 22:21:51 +02:00
pragmas revert changes 2019-07-25 23:18:20 +01:00
proc fixes #10838 (#10841) 2019-03-18 11:04:01 +01:00
procvar Merge tests into a larger file (part 5 of ∞) (#9368) 2018-10-16 10:50:10 +02:00
range Tighten the conversion from tyRange to scalar types (#10495) 2019-02-23 11:52:52 +01:00
rational require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
realtimeGC WIP, most tests are now skipped 2018-12-11 21:23:18 +01:00
rodfiles remove dead code elimination option (#7669) 2018-04-23 11:02:38 +02:00
seq Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
sets set[T].len is an alias for set[T].card (#11885) [feature] 2019-08-05 14:27:45 +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 fix #10339 by returning type attached to nkEmpty (#10370) 2019-01-23 11:17:32 +01:00
stdlib Fix issue #10726 - HTTP response without Content-Length is not accessible (#11904) 2019-08-08 08:41:56 +02:00
system fixes #11447 2019-07-06 21:20:16 +02:00
template improved the error message for #11494; closes #11494 2019-07-06 23:59:23 +02:00
testament lots of testament bug fixes and improvements: (#10044) 2018-12-20 11:49:32 +01:00
testdata Fix for #5134 (parseJson(string) should fail on leftover data) (#5203) 2017-01-11 06:50:18 +01:00
threads Fix and reenable thread tests (#11343) 2019-05-28 15:23:09 +02:00
tools fixes linter regressions 2019-07-10 18:59:27 +02:00
trmacros fixes #7524 2019-01-14 12:15:40 +01:00
tuples Tuple error message (#11141); fixes #3211 2019-05-15 17:59:06 +02:00
typerel fix tests 2019-07-08 15:24:20 -07:00
types fixes #11479 (#11641) 2019-07-03 07:22:30 +02:00
untestable Detect local "primary" IP address 2019-03-17 16:58:27 +00:00
usingstmt Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
varres fix tests 2019-07-08 15:24:20 -07:00
varstmt Testament: refactoring; makes the test joiner green 2018-12-11 21:23:23 +01:00
vm int128 on firstOrd, lastOrd and lengthOrd (#11701) 2019-08-07 15:53:16 +02:00
ast_pattern_matching.nim add tastspec (and ast_pattern_matching) (#10863) 2019-03-19 11:45:29 +01:00
config.nims followup on #10573: prevent common user config to interfere with testament (excessiveStackTrace) (#10590) 2019-02-07 12:29:31 +01:00
dummy.txt Remove install.txt and readme.txt (#9521) 2018-10-28 13:36:52 +01:00
js.html
js.nim tests: Trim .nim files trailing whitespace 2015-09-04 23:04:32 +02:00
mmaptest.nim dynlib: use posix module (#11623) 2019-07-08 09:14:35 +02:00
readme.md Testament pre parallel (#9137) 2018-10-12 17:27:47 +02: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 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.