summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
de54815)
Signed-off-by: Jean Privat <jean@pryen.org>
end
test_simple_docunits(simple_du)
end
test_simple_docunits(simple_du)
+
+ for du in docunits do
+ testsuite.add du.to_xml
+ end
end
# Executes multiples doc-units in a shared program.
end
# Executes multiples doc-units in a shared program.
toolcontext.info("Execute doc-unit {du.testcase.attrs["name"]} in {file} {i}", 1)
var res2 = toolcontext.safe_exec("{file.to_program_name}.bin {i} >'{file}.out1' 2>&1 </dev/null")
toolcontext.info("Execute doc-unit {du.testcase.attrs["name"]} in {file} {i}", 1)
var res2 = toolcontext.safe_exec("{file.to_program_name}.bin {i} >'{file}.out1' 2>&1 </dev/null")
- f = new FileReader.open("{file}.out1")
- var n2
- n2 = new HTMLTag("system-err")
- tc.add n2
- var content = f.read_all
+ var content = "{file}.out1".to_path.read_all
var msg = content.trunc(8192).filter_nonprintable
var msg = content.trunc(8192).filter_nonprintable
- n2.append(msg)
- f.close
-
- n2 = new HTMLTag("system-out")
- tc.add n2
- n2.append(du.block)
- var ne = new HTMLTag("error")
- ne.attr("message", "Runtime error")
- tc.add ne
toolcontext.warning(du.location, "error", "ERROR: {tc.attrs["classname"]}.{tc.attrs["name"]} (in {file}): Runtime error\n{msg}")
toolcontext.modelbuilder.failed_entities += 1
end
toolcontext.check_errors
toolcontext.warning(du.location, "error", "ERROR: {tc.attrs["classname"]}.{tc.attrs["name"]} (in {file}): Runtime error\n{msg}")
toolcontext.modelbuilder.failed_entities += 1
end
toolcontext.check_errors
res2 = toolcontext.safe_exec("{file.to_program_name}.bin >'{file}.out1' 2>&1 </dev/null")
end
res2 = toolcontext.safe_exec("{file.to_program_name}.bin >'{file}.out1' 2>&1 </dev/null")
end
- f = new FileReader.open("{file}.out1")
- var n2
- n2 = new HTMLTag("system-err")
- tc.add n2
- var content = f.read_all
+ var content = "{file}.out1".to_path.read_all
var msg = content.trunc(8192).filter_nonprintable
var msg = content.trunc(8192).filter_nonprintable
- n2.append(msg)
- f.close
-
- n2 = new HTMLTag("system-out")
- tc.add n2
- n2.append(du.block)
- var ne = new HTMLTag("failure")
- ne.attr("message", "Compilation Error")
- tc.add ne
toolcontext.warning(du.location, "failure", "FAILURE: {tc.attrs["classname"]}.{tc.attrs["name"]} (in {file}):\n{msg}")
toolcontext.modelbuilder.failed_entities += 1
else if res2 != 0 then
toolcontext.warning(du.location, "failure", "FAILURE: {tc.attrs["classname"]}.{tc.attrs["name"]} (in {file}):\n{msg}")
toolcontext.modelbuilder.failed_entities += 1
else if res2 != 0 then
- var ne = new HTMLTag("error")
- ne.attr("message", "Runtime Error")
- tc.add ne
toolcontext.warning(du.location, "error", "ERROR: {tc.attrs["classname"]}.{tc.attrs["name"]} (in {file}):\n{msg}")
toolcontext.modelbuilder.failed_entities += 1
end
toolcontext.check_errors
toolcontext.warning(du.location, "error", "ERROR: {tc.attrs["classname"]}.{tc.attrs["name"]} (in {file}):\n{msg}")
toolcontext.modelbuilder.failed_entities += 1
end
toolcontext.check_errors
end
# Create and fill the header of a unit file `file`.
end
# Create and fill the header of a unit file `file`.
# A docunit is extracted from the code-blocks of mdocs.
# Each mdoc can contains more than one docunit, and a single docunit can be made of more that a single code-block.
class DocUnit
# A docunit is extracted from the code-blocks of mdocs.
# Each mdoc can contains more than one docunit, and a single docunit can be made of more that a single code-block.
class DocUnit
# The doc that contains self
var mdoc: MDoc
# The doc that contains self
var mdoc: MDoc
columns[ast_location.line_end-1] + ast_location.column_end)
return res
end
columns[ast_location.line_end-1] + ast_location.column_end)
return res
end
+
+ redef fun to_xml
+ do
+ var res = super
+ res.open("system-out").append(block)
+ return res
+ end
+
end
redef class ModelBuilder
end
redef class ModelBuilder