@@ -7,9 +7,9 @@ check the results.
77## Prerequisites
88
99The test runner script is written in [ Ruby] ( https://www.ruby-lang.org/ )
10- and requires Ruby 2.0 or later. The script uses the so-called ` test/unit `
11- library . In some Linux distributions the library is installed together with
12- Ruby, while some distributions may have the library as an optional package,
10+ and requires Ruby 2.0 or later. The script uses the library commonly referred to as
11+ ` test/unit ` . In some Linux distributions, it is installed together with
12+ Ruby, while some distributions may have it as an optional package,
1313or one may need to manually install
1414[ test-unit] ( http://test-unit.github.io/test-unit/en/ ) via the ` gem ` command.
1515
@@ -37,7 +37,7 @@ Alternatively, one can run the test runner script directly:
3737./check.rb
3838```
3939
40- By default, this tests ` form ` found in ` $PATH ` .
40+ By default, this runs tests with the ` form ` executable found in ` $PATH ` .
4141To test another executable, specify its path as a command-line argument:
4242
4343``` bash
@@ -50,7 +50,7 @@ option).
5050
5151By default, all test cases in all FORM files (` *.frm ` ) found in the ` check `
5252directory (not in subdirectories) are used. To select test cases or FORM files
53- to be run, specify their names as command-line arguments. For example:
53+ to run, specify their names as command-line arguments. For example:
5454
5555``` bash
5656./check.rb Issue8
@@ -64,7 +64,7 @@ For more advanced options, refer to the help message using the `--help` option.
6464
6565### Where to add test cases?
6666
67- Currently, the standard test set (run by default) consists of 4 files :
67+ Currently, the standard test set (run by default) includes :
6868
6969- ` examples.frm ` : Examples provided in the manual.
7070- ` features.frm ` : Test cases for newly added features.
@@ -73,11 +73,11 @@ Currently, the standard test set (run by default) consists of 4 files:
7373
7474Each test case in these files should finish in a short time: the timeout is set
7575to 10 seconds. Bigger tests that take more time are put in subdirectories
76- (e.g., ` forcer ` ) and should be specified by command-line options when the test
76+ (e.g., ` extra ` ) and should be specified by command-line options when the test
7777suite is invoked:
7878
7979``` bash
80- ./check.rb -C forcer # The Forcer library must be available in FORMPATH.
80+ ./check.rb -C extra # Extra library files must be available in FORMPATH.
8181```
8282
8383### Structure of a test case
@@ -171,8 +171,31 @@ assert result("F") =~ expr("1 + 2*x + x^2")
171171In this example, ` #require unix? ` ensures that the test runs
172172only on Unix, where ` #pipe ` is expected to work.
173173
174+ ### Available environment variables
175+
176+ The following environment variables are accessible in FORM test cases via preprocessor variables.
177+
178+ - ` FORM `
179+ Path to the currently used FORM executable, possibly with additional command-line options.
180+ Example: ` /home/form-dev/form/build/sources/tvorm -w4 `
181+ - ` TESTFILE `
182+ Path to the FORM test file.
183+ Example: ` /home/form-dev/form/check/examples.frm `
184+ - ` TESTFILEDIR `
185+ Path to the directory containing the FORM test file.
186+ This path is prepended to the ` FORMPATH ` environment variable.
187+ Example: ` /home/form-dev/form/check `
188+ - ` TESTCASE `
189+ Name of the current test case.
190+ Example: ` Var_Symbols_1 `
191+ - ` TESTTMPDIR `
192+ Path to the temporary directory used as the current working directory.
193+ Example: ` /tmp/form_check_20251121-426943-de5rmj/Test_Var_Symbols_1_20251121-426943-cczq26 `
194+
174195### Available methods
175196
197+ The following methods are available in Ruby test programs.
198+
176199#### Execution configuration
177200
178201- ` timeout → integer or float `
@@ -274,6 +297,8 @@ The following methods assume the default format for statistics:
274297
275298### Available instructions
276299
300+ ` check.rb ` recognises the following instructions.
301+
277302- ` #require <condition> `
278303 Ensures that the test is executed only if the specified ` <condition> ` is met.
279304- ` #pend_if <condition> `
0 commit comments