From 103c3110f324d9bab9e8d33680341ddc8ea45a9f Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 29 May 2018 22:49:26 -0400 Subject: [PATCH] src/nitunit: remove warnings from `testing_doc` Signed-off-by: Alexandre Terrasa --- src/testing/testing_doc.nit | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/testing/testing_doc.nit b/src/testing/testing_doc.nit index a77a331..665d38f 100644 --- a/src/testing/testing_doc.nit +++ b/src/testing/testing_doc.nit @@ -58,8 +58,10 @@ class NitUnitExecutor # Is used because a new code-block might just be added to it. var last_docunit: nullable DocUnit = null + # Unit class name in XML output var xml_classname: String is noautoinit + # Unit name in xml output var xml_name: String is noautoinit # The entry point for a new `ndoc` node @@ -79,11 +81,10 @@ class NitUnitExecutor # All extracted docunits var docunits = new Array[DocUnit] - fun show_status - do - toolcontext.show_unit_status(name, docunits) - end + # Display current testing status + fun show_status do toolcontext.show_unit_status(name, docunits) + # Update display when a test case is done fun mark_done(du: DocUnit) do du.is_done = true @@ -274,6 +275,7 @@ class NitUnitExecutor # `file` should be a valid filepath for a Nit source file. private fun create_unitfile(file: String): Writer do + var mmodule = self.mmodule var dir = file.dirname if dir != "" then dir.mkdir var f @@ -292,11 +294,12 @@ class NitUnitExecutor # Can terminate the program if the compiler is not found private fun compile_unitfile(file: String): Int do + var mmodule = self.mmodule var nitc = toolcontext.find_nitc var opts = new Array[String] if mmodule != null then # FIXME playing this way with the include dir is not safe nor robust - opts.add "-I {mmodule.filepath.dirname}" + opts.add "-I {mmodule.filepath.as(not null).dirname}" end var cmd = "{nitc} --ignore-visibility --no-color -q '{file}' {opts.join(" ")} >'{file}.out1' 2>&1