From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20758 invoked by alias); 15 Apr 2008 12:40:45 -0000 Received: (qmail 20746 invoked by uid 22791); 15 Apr 2008 12:40:44 -0000 X-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (83.160.170.119) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 15 Apr 2008 12:40:17 +0000 Received: from cc1341701-a.deven1.ov.home.nl ([82.72.26.122] helo=[192.168.1.104]) by gnu.wildebeest.org with esmtp (Exim 4.63) (envelope-from ) id 1JlkSK-0007tP-Ax for frysk@sourceware.org; Tue, 15 Apr 2008 14:40:14 +0200 Subject: [patch] java main detection vs test cases From: Mark Wielaard To: frysk Content-Type: text/plain Date: Tue, 15 Apr 2008 15:21:00 -0000 Message-Id: <1208263208.3185.27.camel@dijkstra.wildebeest.org> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit X-Spam-Score: -0.8 (/) X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2008-q2/txt/msg00054.txt.bz2 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 * 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 ()