This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] java main detection vs test cases


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 ()



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]