public inbox for frysk@sourceware.org
 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

Hi,

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 Makefile.gen.sh 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.

frysk-common/ChangeLog
2008-04-15  Mark Wielaard  <mwielaard@redhat.com>

    * Makefile.gen.sh (has_java_main): Make regexp more strict.

This enables the following tests:

frysk.rt.TestDisplayValue
frysk.stack.TestLibFunctionStepFrame
frysk.stack.TestSignalStepFrame

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(FunitSimpleInterfaceTest.java:46)
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.

Cheers,

Mark

diff --git a/frysk-common/Makefile.gen.sh b/frysk-common/Makefile.gen.sh
index f05302c..a9114a7 100755
--- a/frysk-common/Makefile.gen.sh
+++ b/frysk-common/Makefile.gen.sh
@@ -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).