From: wisberg Date: Thu, 9 Jun 2005 00:00:17 +0000 (+0000) Subject: new main for my convenience in testing the testing module X-Git-Tag: PRE_ANDY~198 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=857d23c5bc0193156af04731262a800912240270;p=aspectj.git new main for my convenience in testing the testing module --- diff --git a/testing/testsrc/org/aspectj/testing/util/LangUtilTest.java b/testing/testsrc/org/aspectj/testing/util/LangUtilTest.java index 21e4b263d..6535a78be 100644 --- a/testing/testsrc/org/aspectj/testing/util/LangUtilTest.java +++ b/testing/testsrc/org/aspectj/testing/util/LangUtilTest.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.StringTokenizer; import junit.framework.TestCase; +import junit.framework.TestResult; import junit.textui.TestRunner; /** @@ -33,8 +34,16 @@ public class LangUtilTest extends TestCase { = "org.aspectj.testing.util.LangUtilTest"; /** @param args ignored */ - public static void main(String[] args) { - TestRunner.main(new String[] {ME}); + public static void main(String[] args) throws Exception { + class C extends TestRunner { + public TestResult go(String[] a) throws Exception { + return start(a); + } + } + TestResult r = new C().go(new String[] {ME}); + if (!r.wasSuccessful()) { + System.err.println(r.errorCount() + "/" + r.failureCount()); + } } /** diff --git a/testing/testsrc/org/aspectj/testing/util/StreamGrabberTest.java b/testing/testsrc/org/aspectj/testing/util/StreamGrabberTest.java index 9cd882fa8..9dc039e41 100644 --- a/testing/testsrc/org/aspectj/testing/util/StreamGrabberTest.java +++ b/testing/testsrc/org/aspectj/testing/util/StreamGrabberTest.java @@ -22,6 +22,7 @@ package org.aspectj.testing.util; import java.io.PrintStream; import junit.framework.TestCase; +import junit.framework.TestResult; import junit.textui.TestRunner; /** @@ -35,8 +36,16 @@ public class StreamGrabberTest extends TestCase { = "org.aspectj.testing.util.StreamGrabberTest"; /** @param args ignored */ - public static void main(String[] args) { - TestRunner.main(new String[] {ME}); + public static void main(String[] args) throws Exception { + class C extends TestRunner { + public TestResult go(String[] a) throws Exception { + return start(a); + } + } + TestResult r = new C().go(args); + if (!r.wasSuccessful()) { + System.err.println(r.errorCount() + "/" + r.failureCount()); + } } public StreamGrabberTest(String s) { super(s); }