Files
Nim/tests
c-blake 1b3725e395 Add toOpenArray[T](ptr UncheckedArray[T]) for clarity. (#9316)
* Add `toOpenArray[T](ptr UncheckedArray[T])` for clarity.  `ptr array[0,T]`
for some unchecked type already works but A) `UncheckedArray` seems to be
the intended future way for this kind of access, and B) essentially all use
cases will have a `ptr` for that kind of array source and this call signature
lets callers drop the trailing `[]` corresponding to that `ptr` deref.
This PR relates to issue https://github.com/nim-lang/Nim/issues/9001 .

* Add a test for toOpenArray() for UncheckedArray[T]s.
2018-10-12 17:40:07 +02:00
..
2017-07-25 09:28:23 +02:00
2018-10-10 22:47:08 +02:00
2015-03-17 17:50:32 +01:00
2018-10-11 09:54:50 +02:00
2018-02-10 20:55:22 +01:00
2018-02-10 20:55:22 +01:00
2018-05-02 13:34:54 +02:00
2018-05-14 21:38:18 +02:00
2018-10-09 15:19:21 +02:00
2018-09-14 20:10:46 +02:00
2018-10-10 21:00:54 +02:00
2018-09-26 11:32:02 +02:00
2018-07-05 19:14:18 +02:00
2018-08-31 00:30:19 +02:00
2018-08-10 17:27:30 +02:00
2018-07-05 15:51:04 +02:00
2018-04-29 23:26:21 +01:00
2018-10-10 10:21:38 +02:00
2018-10-09 19:54:12 +02:00
2018-01-21 03:04:22 +01:00
2018-09-21 18:59:46 +02:00
2018-07-05 15:51:04 +02:00
2016-08-04 19:36:13 +02:00
2018-08-22 17:34:16 +02:00
2018-10-02 19:54:02 +02:00
2018-10-02 23:31:39 +02:00
2018-09-04 18:25:54 -05:00
2018-02-10 20:55:22 +01:00
2018-08-13 23:16:03 +02:00
2018-07-05 19:14:18 +02:00
2018-05-14 21:38:18 +02:00
2018-06-15 19:46:17 +03:00
2018-09-16 05:44:37 -05:00
2018-08-21 22:14:12 +02:00
2018-05-02 13:34:54 +02:00
2017-11-18 23:03:16 +01:00
2018-09-24 16:00:57 +02:00
2018-08-04 20:10:03 +02:00
2018-10-12 17:27:47 +02:00
2018-09-03 10:02:37 +02:00
2018-08-17 00:34:27 +02:00
2018-09-24 16:00:57 +02:00
2018-09-24 16:00:57 +02:00
2018-08-05 09:59:16 +02:00
2017-07-25 09:28:23 +02:00
2018-10-09 19:54:12 +02:00
2018-10-12 17:27:47 +02: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.