Files
Nim/tests
Oscar Nihlgård f6df2d9956 Sub second time resolution (#6978)
* Add deprecation warnings to recently deprecated procs

* Fix bad usage of the times module

* Introduce sub second resolution

* Fix usage of C's time()

* Switch to nanosecond resolution

* Make Time & Duration opaque again and fix some errors

* Change back to TimeInterval for shorthands

* Fix JS test

* Fix build error for windows

* Undeprecate epochTime

* Documentation and minor changes

* Lots of bugfixes and doc comments

* Attempt to make travis & appveyor green

* Fix edge cases for dealing with the local timezone

* Workaround JS backend overflow/underflow bug

* Use better workaround for not knowing the size of time_t

* Use all available timezones for tests

* Fix indentation

* Add procs for accessing the fractional part of a duration

* Order time units from smallest to largest since it makes more sense

* Include months and years in `TimeUnit`

* Review fix
2018-04-13 07:36:30 +02:00
..
2017-07-25 09:28:23 +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
2017-07-25 09:28:23 +02:00
2014-01-13 02:10:03 +01:00
2018-03-24 15:28:09 +01:00
2018-02-10 20:55:22 +01:00
2017-08-14 17:43:39 +02:00
2016-08-02 14:53:21 +02:00
2018-03-24 15:28:09 +01:00
2017-01-31 23:05:36 +01:00
2018-02-10 20:55:22 +01:00
2018-04-12 20:09:44 +02:00
2017-12-27 21:26:37 +01:00
2018-01-18 09:04:32 +01:00
2018-02-23 11:42:19 +01:00
2018-02-25 17:28:47 +01:00
2018-04-13 07:36:30 +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-04-11 16:48:01 +02:00
2018-02-10 20:55:22 +01:00
2018-04-07 00:39:33 +02:00
2017-09-28 21:52:23 +02:00
2018-03-24 15:28:09 +01:00
2018-02-10 20:55:22 +01:00
2017-11-23 03:12:09 +01:00
2016-01-05 07:52:56 +07:00
2018-04-06 10:09:05 +02:00
2018-03-05 13:38:32 +01:00
2018-04-11 16:48:01 +02:00
2017-11-01 18:13:27 +03:00
2017-11-18 23:03:16 +01:00
2016-08-27 13:26:16 +02:00
2017-02-01 12:09:24 +01:00
2018-04-06 13:10:22 +02:00
2018-04-13 07:36:30 +02:00
2017-07-25 09:28:23 +02:00
2017-07-25 09:28:23 +02:00
2017-12-15 13:24:47 +01:00
2017-07-25 09:28:23 +02:00
2018-03-24 10:10:28 +01: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.