Merge: More nitunit improvement
authorJean Privat <jean@pryen.org>
Thu, 19 May 2016 19:12:28 +0000 (15:12 -0400)
committerJean Privat <jean@pryen.org>
Thu, 19 May 2016 19:12:28 +0000 (15:12 -0400)
commitff93e2d87118c80be23d70e209a3bdfda3f9e584
tree138a49af17c3099d6ee8361638934bf5bdf7c772
parent9955a31b5fbc44698c48d9f0595974d3b4dbee30
parent4873343662d42963615991be0235139de8228d44
Merge: More nitunit improvement

The point of this serie is to make nitunit more usable and make it more sexy than tests.sh (or ad hoc test scripts) for libraries and programs.

## Highlight

* black box tests with .res files
* --nitc of NITC to locate a specific binary to use
* testcases are executed with some ulimits (to limit timeouts)
* the XML generated is more robust

## Black Box Testing

Sometimes, it is easier to validate a `TestCase` by comparing its output with a text file containing the expected result.

For each TestCase `test_bar` of a TestSuite `test_mod.nit`, if the corresponding file `test_mod.sav/test_bar.res` exists, then the output of the test is compared with the file.

The `diff(1)` command is used to perform the comparison.
The test is failed if non-zero is returned by `diff`.

~~~nit
module test_mod is test_suite
class TestFoo
        fun test_bar do
                print "Hello!"
        end
end
~~~

Where `test_mod.sav/test_bar.res` contains

~~~raw
Hello!
~~~

## Option `--nitc`

nitc compiler to use.

By default, nitunit tries to locate the `nitc` program with the environment variable `NITC` or heuristics.
The option is used to indicate a specific nitc binary.

Pull-Request: #2107
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>