summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/gc/gcbench.nim3
-rwxr-xr-xtests/gc/gcleak.nim3
-rwxr-xr-xtests/gc/gcleak2.nim3
-rwxr-xr-xtests/gc/gcleak3.nim3
-rw-r--r--tests/specials.nim2
5 files changed, 14 insertions, 0 deletions
diff --git a/tests/gc/gcbench.nim b/tests/gc/gcbench.nim
index 253b74805..44d952baa 100755
--- a/tests/gc/gcbench.nim
+++ b/tests/gc/gcbench.nim
@@ -161,5 +161,8 @@ proc main() =
   var elapsed = epochTime() - t

   PrintDiagnostics()

   echo("Completed in " & $elapsed & "ms. Success!")

+
+when defined(GC_setMaxPause):
+  GC_setMaxPause 2_000
 

 main()

diff --git a/tests/gc/gcleak.nim b/tests/gc/gcleak.nim
index ab85409ee..c40c6b3b5 100755
--- a/tests/gc/gcleak.nim
+++ b/tests/gc/gcleak.nim
@@ -2,6 +2,9 @@ discard """
   outputsub: "no leak: "
 """
 
+when defined(GC_setMaxPause):
+  GC_setMaxPause 2_000
+
 type
   TTestObj = object of TObject
     x: string
diff --git a/tests/gc/gcleak2.nim b/tests/gc/gcleak2.nim
index bd7962a7e..a50541fbc 100755
--- a/tests/gc/gcleak2.nim
+++ b/tests/gc/gcleak2.nim
@@ -2,6 +2,9 @@ discard """
   outputsub: "no leak: "
 """
 
+when defined(GC_setMaxPause):
+  GC_setMaxPause 2_000
+
 type
   TTestObj = object of TObject
     x: string
diff --git a/tests/gc/gcleak3.nim b/tests/gc/gcleak3.nim
index 70aeda3bb..588e238e9 100755
--- a/tests/gc/gcleak3.nim
+++ b/tests/gc/gcleak3.nim
@@ -2,6 +2,9 @@ discard """
   outputsub: "no leak: "
 """
 
+when defined(GC_setMaxPause):
+  GC_setMaxPause 2_000
+
 type
   TSomething = object
     s: string
diff --git a/tests/specials.nim b/tests/specials.nim
index 99e5c4c10..da2013e02 100644
--- a/tests/specials.nim
+++ b/tests/specials.nim
@@ -122,6 +122,8 @@ proc runGcTests(r: var TResults, options: string) =
   template test(filename: expr): stmt =
     runSingleTest(r, "tests/gc" / filename, options)
     runSingleTest(r, "tests/gc" / filename, options & " -d:release")
+    runSingleTest(r, "tests/gc" / filename, options &
+                  " -d:release -d:useRealtimeGC")
   
   test "gcbench"
   test "gcleak"
iteral.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
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](https://github.com/nim-lang/Nim/blob/devel/testament/specs.nim#L124) 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:

```nim
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.