nitunit: introduce `is_compiled` to see if a unit file is compiled
authorJean Privat <jean@pryen.org>
Tue, 20 Jun 2017 17:35:17 +0000 (13:35 -0400)
committerJean Privat <jean@pryen.org>
Tue, 20 Jun 2017 17:35:17 +0000 (13:35 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/testing/testing_doc.nit

index a17c8ab..69259ea 100644 (file)
@@ -119,7 +119,7 @@ class NitUnitExecutor
                for du in docunits do
                        if du.error != null then
                                # Nothing to execute. Conclude
-                       else if du.test_file != null then
+                       else if du.is_compiled then
                                # Already compiled. Execute it.
                                execute_simple_docunit(du)
                        else
@@ -186,6 +186,7 @@ class NitUnitExecutor
                        i += 1
                        du.test_file = file
                        du.test_arg = i
+                       du.is_compiled = true
                end
        end
 
@@ -403,6 +404,9 @@ class DocUnit
        # See `test_arg` that is used to distinguish them
        var test_file: nullable String = null
 
+       #  Was `test_file` successfully compiled?
+       var is_compiled = false
+
        # The command-line argument to use when executing the test, if any.
        var test_arg: nullable Int = null