nitdoc: increase the verbosity level for the numerous skip messages
[nit.git] / src / testing / testing_suite.nit
index acf5650..0f1b117 100644 (file)
@@ -17,6 +17,7 @@ module testing_suite
 
 import testing_base
 import html
+private import annotation
 
 redef class ToolContext
        # -- target-file
@@ -213,8 +214,8 @@ class TestCase
        fun compile do
                # find nitg
                var nit_dir = toolcontext.nit_dir
-               var nitg = "{nit_dir or else ""}/bin/nitg"
-               if nit_dir == null or not nitg.file_exists then
+               var nitg = nit_dir/"bin/nitg"
+               if not nitg.file_exists then
                        toolcontext.error(null, "Cannot find nitg. Set envvar NIT_DIR.")
                        toolcontext.check_errors
                end
@@ -230,7 +231,7 @@ class TestCase
                var loc = test_method.location
                if res != 0 then
                        failure = msg
-                       toolcontext.warning(loc, "FAILURE: {test_method.name} (in file {file}.nit): {msg}")
+                       toolcontext.warning(loc, "failure", "FAILURE: {test_method.name} (in file {file}.nit): {msg}")
                        toolcontext.modelbuilder.failed_tests += 1
                end
                toolcontext.check_errors
@@ -243,7 +244,7 @@ class TestCase
                if toolcontext.opt_noact.value then return
                # execute
                var file = test_file
-               var res = sys.system("./{file}.bin > '{file}.out1' 2>&1 </dev/null")
+               var res = sys.system("{file.to_program_name}.bin > '{file}.out1' 2>&1 </dev/null")
                var f = new IFStream.open("{file}.out1")
                var msg = f.read_all
                f.close
@@ -251,7 +252,7 @@ class TestCase
                var loc = test_method.location
                if res != 0 then
                        error = msg
-                       toolcontext.warning(loc, "ERROR: {test_method.name} (in file {file}.nit): {msg}")
+                       toolcontext.warning(loc, "failure", "ERROR: {test_method.name} (in file {file}.nit): {msg}")
                        toolcontext.modelbuilder.failed_tests += 1
                end
                toolcontext.check_errors
@@ -271,7 +272,7 @@ class TestCase
                var mclassdef = test_method.mclassdef
                var tc = new HTMLTag("testcase")
                # NOTE: jenkins expects a '.' in the classname attr
-               tc.attr("classname", mclassdef.mmodule.full_name + "." + mclassdef.mclass.full_name)
+               tc.attr("classname", "nitunit." + mclassdef.mmodule.full_name + "." + mclassdef.mclass.full_name)
                tc.attr("name", test_method.mproperty.full_name)
                if was_exec then
                        tc.add  new HTMLTag("system-err")
@@ -382,13 +383,13 @@ redef class ModelBuilder
                        test_file = "{include_dir}/{test_file}"
                end
                if not test_file.file_exists then
-                       toolcontext.info("Skip test for {mmodule}, no file {test_file} found", 1)
+                       toolcontext.info("Skip test for {mmodule}, no file {test_file} found", 2)
                        return ts
                end
                var tester = new NitUnitTester(self)
                var res = tester.test_module_unit(test_file)
                if res == null then
-                       toolcontext.info("Skip test for {mmodule}, no test suite found", 1)
+                       toolcontext.info("Skip test for {mmodule}, no test suite found", 2)
                        return ts
                end
                return res.to_xml