mgunit 1.1 is available for download. The release notes for 1.1 are:

  1. Added an extra argument to ASSERT which can be inserted into the message via C-style format codes.

  2. Added XML and JUnit output formats (and corresponding XML and JUNIT keywords to MGUNIT to turn them on).

  3. Added ability for a test to determine if it should count in the final results tally, i.e., if it is “skipped”. Use the SKIP keyword of ASSERT to skip a test instead of failing it if the condition is not met.

  4. Fixed memory leak.

Both 1. and 3. involve more parameters for ASSERT.

For example, it can be handy to produce error messages containing values from local variables, but it is painful to have to use STRTRIM or STRING to format the message nicely. The following ASSERT call will insert the values for result and standard into the appropriate locations in the message:

assert, condition, 'incorrect result, %f; expecting %f', $
        result, standard

You can pass up to three values this way.

Skipped tests allow a test to determine if it should be run and counted in the total number of tests. For example, in GPULib there are many tests which test double-precision calculations, but these are only valid if the GPU is capable of double-precision. Previously, these counted as failures and we just had to know that passing 150 out 200 tests was “OK” if the GPU was not double capable. Now these tests can be skipped with the following:

assert, gpuDoubleCapable(), 'CUDA device not double capable', /skip

A skipped test will not count the total number of tests (though it is indicated afterward, i.e. “3/4 tests passed, 2 skipped”).