cs3110/tools — pull request #110 by bennn (2014-09-24 00:21:02+00:00)
Title: Better error messages when harness cannot get unit test names

Before the harness runs any submissions, it:

1. Copies each test file into the release folder
2. Runs the tests in these test files
3. Reads a file of test names generated by pa_ounit

After this PR, there's a clearer error message when the harness fails to compile and run a test file in the release directory (i.e., either the release or the test raise an exception that is not caught by `pa_ounit`).

Here's example output generated by a test file that calls a function stub in the release folder:

```
> cs3110 harness -v Submissions/mrc
[harness] Parsing options...
[harness] collecting unit test names for file 'tests/exprTree_test.ml'...
[harness] copying the test 'tests/exprTree_test.ml' into directory 'release'...
[harness] running tests in file 'release/exprTree_test.ml'...
[test] Preparing to run inline tests from target 'exprTree_test.ml'.
[compile] Preparing to compile file 'exprTree_test.ml'
[compile] Target is 'exprTree_test.d.byte'
[compile] Included directories are []
[compile] Linked libraries are [-lib; assertions]
[compile] Compiler flags are [-cflag; -warn-error; -cflag; +a-4-33-34-40-41-42-43-44]
[compile] ocamlbuild flags are [-use-ocamlfind; -no-links; -tag-line; <**/*.ml{,i}> : syntax(camlp4o), package(oUnit), package(pa_ounit), package(pa_ounit.syntax), package(qcheck); -tag-line; <**/*.d.byte> : package(oUnit), package(pa_ounit), package(pa_ounit.syntax), package(qcheck); -tag-line; <**/*.native> : package(oUnit), package(pa_ounit), package(pa_ounit.syntax), package(qcheck)]
[compile] Compilation succeeded!
[test] Test command is '././_build/exprTree_test.d.byte inline-test-runner dummy -log &> /dev/null'.
Error (exit code 2)
```

The "better error message" is the last thing the harness says:
`[harness] running tests in file 'release/exprTree_test.ml'...`
While trying to run the tests, the harness exited with code 2.