Merge: Nitunit: mass compile non-simple docunits
authorJean Privat <jean@pryen.org>
Fri, 1 Jun 2018 17:10:02 +0000 (13:10 -0400)
committerJean Privat <jean@pryen.org>
Fri, 1 Jun 2018 17:10:02 +0000 (13:10 -0400)
When docunits are simple (just statements), a single module is generated for all.
Unfortunately, when docunits contains classes or importations, a specific module must be generated for each one of them.
Compiling all these module takes most of the nitunit elapsed time.

This PR tries to compile these non-simple modules at once, thanks to nitc that features invoking it with multiple programs.

Testing with `nitunit lib/popcorn/README.md`

Before:
* cold ccache: 1m3,832s
* hot ccache: 0m23,063s

After:
* cold ccache: 0m44,517s (-30%)
* hot ccache: 0m17,778s (-23%)

Pull-Request: #2510
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>

1  2 
src/testing/testing_doc.nit
tests/sav/nitunit_args1.res

Simple merge
@@@ -1,7 -1,7 +1,7 @@@
 -==== Docunits of module test_nitunit::test_nitunit | tests: 4
 +==== Docunits of module test_nitunit::test_nitunit | tests: 5
  [OK] test_nitunit::test_nitunit
  [KO] test_nitunit$X
-      test_nitunit.nit:21,7--22,0: Runtime error in nitunit.out/test_nitunit-2.nit
+      test_nitunit.nit:21,7--22,0: Runtime error in nitunit.out/test_nitunit-2.nit with argument 0
       Output
        Runtime error: Assert failed (nitunit.out/test_nitunit-2.nit:5)
  
  
  [OK] test_test_nitunit$TestX$test_foo2
  
 -Docunits: Entities: 34; Documented ones: 6; With nitunits: 4; Failures: 3
 +Docunits: Entities: 34; Documented ones: 7; With nitunits: 5; Failures: 3
  Test suites: Classes: 1; Test Cases: 3; Failures: 1
 -[FAILURE] 4/7 tests failed.
 +[FAILURE] 4/8 tests failed.
  `nitunit.out` is not removed for investigation.
  <testsuites><testsuite package="test_nitunit::test_nitunit"><testcase classname="nitunit.test_nitunit::test_nitunit.&lt;module&gt;" name="&lt;module&gt;" time="0.0"><system-err></system-err><system-out>assert true
- </system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="&lt;class&gt;" time="0.0"><error message="Runtime error in nitunit.out&#47;test_nitunit-2.nit">Runtime error: Assert failed (nitunit.out&#47;test_nitunit-2.nit:5)
+ </system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="&lt;class&gt;" time="0.0"><error message="Runtime error in nitunit.out&#47;test_nitunit-2.nit with argument 0">Runtime error: Assert failed (nitunit.out&#47;test_nitunit-2.nit:5)
  </error><system-out>assert false
  </system-out></testcase><testcase classname="nitunit.test_nitunit.X" name="foo" time="0.0"><failure message="Compilation error in nitunit.out&#47;test_nitunit-3.nit">nitunit.out&#47;test_nitunit-3.nit:5,8--27: Error: method or variable `undefined_identifier` unknown in `Sys`.
  </failure><system-out>assert undefined_identifier