Updating test cases when the output changes

If the output of a test has changed, but the new output is still correct, you can automatically update the sample output to match the new output like so:

$ make accept TEST=<test-name>

where <test-name> is the name of the test.

If you want to update a whole directory of tests to accept the new output, simply call make accept in that directory:

$ cd array/should_run
$ make accept

make accept does not change the expected output of tests that are marked as expect_broken or expect_broken_for.

It is also possible to accept test changes only for a specific platform or os.

$ make accept TEST=<test-name> [OS=YES | PLATFORM=YES]

However please avoid this as much as possible and if applicable use a custom formatter to format the output in a platform neutral way. See e.g. normalise_errmsg_fun

Performance tests

Some of the performance tests in perf/ check for peak memory usage. Peak memory usage is obtained when there is a major GC, so the peak value can be vulnerable to the timing of major GC. If peak_megabytes appears to increase, try running with RTS -h -i0.01 before and after. That makes major GC happen more often, and gives a much more accurate result.

Last modified 19 months ago Last modified on Mar 31, 2018 10:24:34 AM