It is expected that the created/updated files are checked since the tests are considered passed.
A VCS like `git` is often a good tool to check the creation and modification of those files.
+### `--no-time`
+Disable time information in XML.
+
+This is used to have reproducible XML results.
+
+This option is automatically activated if `NIT_TESTING` is set.
+
## SUITE GENERATION
### `--gen-suite`
exit(0)
end
+# When testing `nitunit`, disable time.
+if "NIT_TESTING".environ != "" then
+ toolcontext.opt_no_time.value = true
+end
+
"NIT_TESTING".setenv("true")
"NIT_TESTING_ID".setenv(pid.to_s)
"SRAND".setenv("0")
var opt_noact = new OptionBool("Does not compile and run tests", "--no-act")
# opt --nitc
var opt_nitc = new OptionString("nitc compiler to use", "--nitc")
+ # opt --no-time
+ var opt_no_time = new OptionBool("Disable time information in XML", "--no-time")
# Working directory for testing.
fun test_dir: String do
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
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
var res_name = "{test_file}_{method_name.escape_to_c}"
var clock = new Clock
var res = toolcontext.safe_exec("{test_file}.bin {method_name} > '{res_name}.out1' 2>&1 </dev/null")
- real_time = clock.total
+ if not toolcontext.opt_no_time.value then real_time = clock.total
var raw_output = "{res_name}.out1".to_path.read_all
self.raw_output = raw_output