nitunit: introduce before/after class tests
[nit.git] / src / testing / testing_doc.nit
index 1180bff..0121162 100644 (file)
@@ -44,7 +44,7 @@ class NitUnitExecutor
        var mdproc = new MarkdownProcessor
 
        init do
-               mdproc.emitter.decorator = new NitunitDecorator(self)
+               mdproc.decorator = new NitunitDecorator(self)
        end
 
        # The associated documentation object
@@ -197,7 +197,7 @@ class NitUnitExecutor
                toolcontext.info("Execute doc-unit {du.full_name} in {file} {i}", 1)
                var clock = new Clock
                var res2 = toolcontext.safe_exec("{file.to_program_name}.bin {i} >'{file}.out1' 2>&1 </dev/null")
-               du.real_time = clock.total
+               if not toolcontext.opt_no_time.value then du.real_time = clock.total
                du.was_exec = true
 
                var content = "{file}.out1".to_path.read_all
@@ -230,7 +230,7 @@ class NitUnitExecutor
                if res == 0 then
                        var clock = new Clock
                        res2 = toolcontext.safe_exec("{file.to_program_name}.bin >'{file}.out1' 2>&1 </dev/null")
-                       du.real_time = clock.total
+                       if not toolcontext.opt_no_time.value then du.real_time = clock.total
                        du.was_exec = true
                end
 
@@ -263,7 +263,7 @@ class NitUnitExecutor
                f.write("# GENERATED FILE\n")
                f.write("# Docunits extracted from comments\n")
                if mmodule != null then
-                       f.write("import {mmodule.name}\n")
+                       f.write("intrude import {mmodule.name}\n")
                end
                f.write("\n")
                return f