Individual tests are subdirectories in the tests
directory. Each test has
a code snippet main.gs
that is run using the debug script
tests/test_script
and leaves the result in test.log
. That log is then additionally post-processed into
other *.log
files. *.log.ref
are corresponding reference results.
Run tests with ./run_tests
. Re-generate reference output with ./run_tests -r
.
Each test runs a sample code snippet and compares the result in several ways with a stored reference.
Test results should be stable but for core language changes. Tests compare results in varying degrees of detail (e.g. 'mem' - 'trace' - 'basic') to make it easier to decide whether a change is to be expected or not.
Basically every core language change will invalidate 'mem' results but leave 'basic' intact. 'trace' changes but not that often.
'code1' and 'code2' are the same as 'code' but with code optimizations enabled.
'opt1' and 'opt2' are the same level of detail as 'trace' but with code optimizations enabled.
Check a full execution log including variable values and internal object ids (like 'trace' but optimization with -O1).
Check a full execution log including variable values and internal object ids (like 'trace' but optimization with -O2).
Check the garbage collector. This test is a bit different. It does not compare against a stored reference. After releasing all object references, the test verifies that the memory is in the initial state again.