This is the mail archive of the
mauve-patches@sourceware.org
mailing list for the Mauve project.
Re: RFC: add "not-a-test" tag to several tests
Hi Tony,
On Mon, 2006-06-26 at 10:20 -0400, Anthony Balkissoon wrote:
> The RunnerProcess change will come later along with more changes to
> RunnerProcess.
I have a few local changes to RunnerProcess that I haven't cleanup up
yet, but that you might find handy. They make it possible to use
RunnerProcess just as you could use SimpleTestHarness (e.g. echo
gnu.testlet.some.test | runtime RunnerProcess) by just returning when
stdin is empty (and in.readLine() returns null). And it makes sure the
description of a test is always set to prevent null pointer exceptions
later on when a test isn't loaded correctly (and doesn't contain a Tag:
not-a-test). It also outputs a FAIL: line in such a case. If you could
take a look and/or incorporate those changes into your patches that
would be appreciated.
Cheers,
Mark
Index: RunnerProcess.java
===================================================================
RCS file: /cvs/mauve/mauve/RunnerProcess.java,v
retrieving revision 1.8
diff -u -r1.8 RunnerProcess.java
--- RunnerProcess.java 19 Jun 2006 22:07:37 -0000 1.8
+++ RunnerProcess.java 26 Jun 2006 14:38:21 -0000
@@ -195,6 +195,8 @@
try
{
testname = in.readLine();
+ if (testname == null)
+ return;
if (testname.equals("_dump_data_"))
{
if (useEMMA)
@@ -238,6 +240,7 @@
System.runFinalization();
currentResult = new TestResult(name.substring(12));
+ description = name;
checkPoint(null);
@@ -251,7 +254,6 @@
description = NOT_A_TEST_DESCRIPTION;
return;
}
-
t = (Testlet) o;
}
catch (Throwable ex)
@@ -282,12 +284,13 @@
{
}
- String d = "FAIL: " + stripPrefix(name)
- + "uncaught exception when loading";
+ String d = "FAIL: " + stripPrefix(name);
currentResult.addException(ex, "failed loading class ",
"couldn't load: " + name);
if (verbose || exceptions)
- d += ": " + ex.toString();
+ d += " (while loading): " + ex.toString();
+
+ System.out.println(d);
if (exceptions)
ex.printStackTrace(System.out);
@@ -303,7 +306,6 @@
// If the harness started okay, now we run the test.
if (t != null)
{
- description = name;
try
{
if (verbose)