Files
Nim/tests
Araq bca07265a4 tests/ic: say how to run the suite, and how to tell slow from hung
The metamorphic tests compile the program twice per step — once under `nim ic`,
once as the `nim c` reference — which is 100+ compilations for the category,
each fanning out a compiler process per module per stage. On a machine short of
RAM that swaps, and the symptoms read exactly like a deadlock: processes at 0%
CPU, no output, a different test "stuck" every run, and the same compilation
finishing in seconds standalone.

It is not a deadlock. A `nim ic` parent at 0% CPU is waiting on its children,
and the test name does keep changing if you watch long enough. Writing this down
because it has now been misdiagnosed as a testament/`nim ic` interaction more
than once, by me, before I measured `vm_stat` and `vm.swapusage`.

Also records the fan-out caps (`--parallelBuild:N`, `-d:icJobs:N`,
`-d:icNoParallel`), that serial mode is what makes per-process diagnostic output
readable rather than interleaved, that `testament r` cannot run a multi-step
metamorphic file, and that `*_temp.nim` are gitignored scratch rather than tests.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XEF7FJvUkGKvG9LSGuEaNR
2026-08-30 11:15:21 +02:00
..
2026-04-07 18:07:34 +02:00
2024-06-06 00:52:01 +02:00
2026-08-11 22:27:49 +02:00
2021-08-21 08:22:00 +02:00
2026-06-13 11:06:51 +08:00
2023-07-22 21:11:08 +02:00
2026-06-13 11:06:51 +08:00
2025-12-18 18:54:03 +01:00
2026-06-08 22:47:42 +08:00
2026-06-13 11:06:51 +08:00
2026-06-13 11:06:51 +08:00
2026-08-17 12:22:53 +02:00
2026-06-13 11:06:51 +08:00
2026-04-20 20:13:06 +02:00
2025-03-29 13:28:28 +01:00
2022-12-22 08:32:12 +01:00
2020-12-28 14:13:21 +01:00

This directory contains the test cases.

Each test must have a filename of the form: t*.nim

Note: Testament is only aware of tests under a directory (eg tests/foo/) and will ignore top-level tests like tests/tbar.nim.

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: run

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.

Categories

Each folder under this directory represents a test category, which can be tested by running koch tests pcat <category> (or cat to avoid parallel testing, which is slower).

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.