Files
Nim/tests
Vindaar eff0837ff4 fixes #12015 by also checking kind of typeNode (#12016)
* fixes #12015 by also checking kind of `typeNode`

If a tuple field is aliased it'll appear the same as a ref type in a
call to `getType` if only for the kind of the resulting `NimNode` is
checked (that is a `nnkBracketExpr`)

* fix test case due to #12017 and add more realistic test case

Adds an additional test case, which includes generics and is closer to
the real failure I encountered

* remove previous fix and fix differently after all

The previous fix was incomplete, because it failed for generics.

Note that the `of "tuple"` is not actually needed, the
`nnkBracketExpr` branch in the `else` branch would catch it too, but I
decided to introduce it for clarity. However, the latter is actually
needed, because it seems for aliases of `seq` we end up in it.

* update comment about global `%` proc in json test
2019-08-27 22:23:47 +02:00
..
2017-07-25 09:28:23 +02:00
2019-07-06 20:02:50 +02:00
2019-07-01 13:19:07 +02:00
2019-05-27 21:29:02 +02:00
2019-08-23 16:15:02 +02:00
2019-07-09 19:38:38 +02:00
2019-06-26 23:41:20 +02:00
2019-05-25 07:33:33 +02:00
2019-05-14 01:28:44 +02:00
2019-05-27 21:29:02 +02:00
2014-01-13 02:10:03 +01:00
2019-08-07 22:40:58 +02:00
2019-04-05 14:50:57 +02:00
2019-02-12 22:00:31 +01:00
2019-04-30 21:46:45 +01:00
2019-08-24 06:25:47 +02:00
2019-07-13 07:55:56 +02:00
2019-08-24 06:25:47 +02:00
2019-08-17 21:19:57 +02:00
2019-05-27 21:29:02 +02:00
2019-08-21 22:03:04 +02:00
2018-12-11 21:23:22 +01:00
2019-05-30 11:18:17 +02:00
2019-07-25 10:05:02 +02:00
2019-03-05 05:53:28 +01:00
2018-12-11 21:23:25 +01:00
2019-05-21 21:31:40 +02:00
2019-05-29 12:11:03 +02:00
2019-08-27 10:07:42 +02:00
2019-05-28 22:00:01 +02:00
2019-08-23 18:58:55 +02:00
2019-05-29 22:21:51 +02:00
2018-12-11 21:23:26 +01:00
2019-06-02 06:33:35 +02:00
2019-08-26 20:13:41 +02:00
2019-05-29 22:21:51 +02:00
2019-07-25 23:18:20 +01:00
2019-08-26 20:14:21 +02:00
2019-08-26 20:12:22 +02:00
2019-08-23 16:15:02 +02:00
2019-01-14 12:15:40 +01:00
2019-07-08 15:24:20 -07:00
2019-07-03 07:22:30 +02:00
2019-07-08 15:24:20 -07:00
2013-03-16 23:53:07 +01:00
2019-07-08 09:14:35 +02:00
2018-10-12 17:27:47 +02:00
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.