public inbox for
 help / color / mirror / Atom feed
* [patch] java main detection vs test cases
@ 2008-04-15 15:21 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2008-04-15 15:21 UTC (permalink / raw)
  To: frysk


To my horror some of my tests weren't run on make check. Even though
they ran fine when invoking ./TestRunner test by hand. What was
happening was that a couple of tests has "main()" in some comment. This
triggered into turning them into executable instead of
junit test cases. This patch makes the regexp detection more strict as
to eliminate some of these false positives.

2008-04-15  Mark Wielaard  <>

    * (has_java_main): Make regexp more strict.

This enables the following tests:


Those all pass (or contain unresolved tests) on x86 and x86_64 (at least
on fedora 8).

There is still one "false positive" of a slightly different category:

Exception in thread "main" java.lang.NullPointerException
   at FunitSimpleInterfaceTest.main(
FAIL: frysk/pkglibdir/FunitSimpleInterfaceTest

This is part of the frysk.debuginfo.TestGccInterface test (which
passes). It should be an executable, but it shouldn't also be run as a
separate test program. I filed bug #6408 for this.



diff --git a/frysk-common/ b/frysk-common/
index f05302c..a9114a7 100755
--- a/frysk-common/
+++ b/frysk-common/
@@ -328,7 +328,7 @@ has_java_source ()
 has_java_main ()
-    grep ' main[ ]*[(]' $1 > /dev/null 2>&1
+    grep ' void main[ ]*[(][ ]*String' $1 > /dev/null 2>&1
 has_main ()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-15 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15 15:21 [patch] java main detection vs test cases Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).