[Nice-commit] Nice/src/nice/tools/testsuite runner.nice,1.2,1.3
Brought to you by:
bonniot
From: Artem Gr K. <ar...@us...> - 2005-08-29 12:57:46
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21591/src/nice/tools/testsuite Modified Files: runner.nice Log Message: Suppres compilation progress. Report errors via System.exit(). Index: runner.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/runner.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** runner.nice 12 Apr 2005 15:52:54 -0000 1.2 --- runner.nice 29 Aug 2005 12:57:38 -0000 1.3 *************** *** 33,36 **** --- 33,42 ---- let File tmp = new File("temp-testcase"); + class EmbeddedDSLOutput extends nice.tools.compiler.console.ConsoleOutput { + progress(packageName, phase){} + } + + var int ERRORS = 0; + public void main(String[] args) { *************** *** 39,42 **** --- 45,52 ---- if (f.isDirectory() && f.hasNiceFile()) test(f)); + if(ERRORS != 0) println( "ERRORS: "ERRORS ); + // 127 and negative values are used by "system", so 126 is a maximum value to be returned by "waitpid" + // (see "man 3 system", "man 2 waitpid"). + if(ERRORS != 0) System.exit(min(ERRORS, 126)); } *************** *** 50,54 **** println("\nCompiling "pkg); ! let output = consoleOutput(); let compilation = new bossa.modules.Compilation (listener: output, parser: new bossa.parser.JavaccParser(), destinationDir: tmp.getPath()); --- 60,64 ---- println("\nCompiling "pkg); ! let output = new EmbeddedDSLOutput(); let compilation = new bossa.modules.Compilation (listener: output, parser: new bossa.parser.JavaccParser(), destinationDir: tmp.getPath()); *************** *** 58,66 **** compile(compilation, pkg); ! if (output.errorCount > 0) ! return; println("\nTesting "pkg); let testListener = new nice.tools.unit.console.Listener(); ! runTests(pkg, testListener, new File(tmp, "test.jar") + File.pathSeparator + "classes"); } --- 68,77 ---- compile(compilation, pkg); ! if (output.errorCount > 0){ ++ERRORS; return; } println("\nTesting "pkg); let testListener = new nice.tools.unit.console.Listener(); ! let ok = runTests(pkg, testListener, new File(tmp, "test.jar") + File.pathSeparator + "classes"); ! if (! ok) ++ERRORS; ! ERRORS += testListener.nFailures; } |