import testing_base
import html
+private import annotation
redef class ToolContext
# -- target-file
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
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
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
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
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")
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