Files
Nim/tests
Zahary Karadjov bdcb729597 Better support for treating templates and macros as symbols.
This allows you to pass a template or a macro to another macro
which can then inspect the implementation of the former template/macro
using `getImpl`.

Since templates can be freely redefined, this allows you to treat
their symbols as compile-time variables that have lexical scope.
A motivating PoC example for a logging library taking advantage of
this will be provided in the next commit.

Implementation details:

* The name of a template or a macro will be consider a symbol if
  the template/macro requires parameters

* For parameterless templates/macros, you can use `bindSym`, which
  was extended to also work outside of compile-time procs.
2018-05-07 09:37:49 +02:00
..
2017-07-25 09:28:23 +02:00
2018-04-24 11:45:08 +02:00
2018-05-05 21:45:07 +02:00
2018-02-10 20:55:22 +01:00
2015-03-17 17:50:32 +01:00
2018-04-06 10:53:21 +02:00
2018-03-23 13:28:22 +01:00
2018-02-10 20:55:22 +01:00
2018-02-10 20:55:22 +01:00
2018-05-05 21:45:07 +02:00
2018-05-02 13:34:54 +02:00
2014-01-13 02:10:03 +01:00
2018-04-30 11:16:56 +02:00
2018-02-10 20:55:22 +01:00
2018-05-02 13:34:54 +02:00
2018-05-02 13:34:54 +02:00
2018-04-22 00:19:41 +02:00
2018-05-02 13:34:54 +02:00
2018-05-02 13:34:54 +02:00
2018-04-28 10:00:31 +02:00
2018-05-05 21:45:07 +02:00
2018-01-18 09:04:32 +01:00
2018-02-23 11:42:19 +01:00
2018-04-15 17:34:03 +02:00
2018-01-21 03:04:22 +01:00
2018-02-10 20:55:22 +01:00
2017-11-05 13:02:46 +01:00
2016-08-04 19:36:13 +02:00
2018-05-02 13:34:54 +02:00
2018-05-02 13:34:54 +02:00
2018-04-30 02:56:19 +02:00
2018-05-05 21:45:07 +02:00
2018-02-10 20:55:22 +01:00
2018-05-02 13:34:54 +02:00
2018-05-02 13:34:54 +02:00
2016-01-05 07:52:56 +07:00
2018-05-02 13:34:54 +02:00
2018-05-06 08:17:32 +02:00
2018-05-02 13:34:54 +02:00
2018-05-02 13:34:54 +02:00
2017-11-18 23:03:16 +01:00
2017-02-01 12:09:24 +01:00
2018-04-06 13:10:22 +02:00
2018-04-18 21:19:23 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2017-07-25 09:28:23 +02:00
2018-04-21 23:58:24 +02:00
2018-04-30 11:16:56 +02:00
2013-03-16 23:53:07 +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.