Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 88375 invoked from network); 21 Feb 2008 15:44:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2008 15:44:02 -0000 Received: (qmail 2442 invoked by uid 500); 21 Feb 2008 15:43:56 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 2426 invoked by uid 500); 21 Feb 2008 15:43:56 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 2417 invoked by uid 99); 21 Feb 2008 15:43:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 07:43:56 -0800 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.6.21] (HELO gmp-eb-inf-1.sun.com) (192.18.6.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 15:43:09 +0000 Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe2.eu.sun.com [192.18.6.11]) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m1LFhTid001686 for ; Thu, 21 Feb 2008 15:43:30 GMT Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JWL00H01HZ1WC00@fe-emea-09.sun.com> (original mail from Vemund.Ostgaard@Sun.COM) for derby-dev@db.apache.org; Thu, 21 Feb 2008 15:43:29 +0000 (GMT) Received: from [129.159.112.187] by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JWL002DNIC9SQ10@fe-emea-09.sun.com> for derby-dev@db.apache.org; Thu, 21 Feb 2008 15:43:22 +0000 (GMT) Date: Thu, 21 Feb 2008 16:43:21 +0100 From: Vemund Ostgaard Subject: Re: Using EMMA for codecoverage analysis In-reply-to: <47BC636E.4090806@apache.org> Sender: Vemund.Ostgaard@Sun.COM To: derby-dev@db.apache.org Message-id: <47BD9C19.3080405@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <47AC7399.6070602@sun.com> <47BC398E.9040301@sun.com> <47BC636E.4090806@apache.org> User-Agent: Thunderbird 2.0.0.9 (X11/20071119) X-Virus-Checked: Checked by ClamAV on apache.org Daniel John Debrunner wrote: > Vemund Ostgaard wrote: >> I got suites.All to run with EMMA, but I had to add 7-8 lines to >> derby_tests.policy and modify a couple of tests before it ran cleanly. >> >> I think it would be good if this worked without editing the source, >> so I'll make a Jira and upload a patch with these changes. > > It might be good to separate out the test changes, I'd be interested > to understand why they needed to be changed to run under code coverage. I will do that. I've only fixed suites.All, but I saw similar cases in the derbyall test as well. I think the emma instrumentation affects the tests in two ways: 1. Running instrumented code requires emma.jar in the classpath. If a test forks a new process that runs instrumented code (for instance ij) the new process also needs emma.jar in the classpath. The same is true if a test creates a new classloader that loads an instrumented class, emma.jar is needed in that classloaders search URL as well. 2. Code instrumented by EMMA will by default write some output, which some tests don't like. Using -Demma.verbosity.level=silent when starting junit solves this for most tests, but if a test forks a new process it may have to set the emma.verbosity.level for that process as well if it is touchy about the extra output. It was only two tests in suites.All that needed modifications, but I guess we might see these two issues also in the future when new tests are written. > >> I'm thinking about adding some ant tasks for instrumenting >> classes/jars and running the junit-tests with EMMA, making it easier >> to do this. > > +1 I hadn't run the junit tests with ant before and had some problems running them with ant 1.6.5, so I switched to ant 1.7 and it is working better. I'm now working my way through the extra permissions needed for junit.jar and ant-junit.jar when running with instrumented jarfiles. I also think some permissions are needed when running with ant 1.7 that wasn't needed when running with ant 1.6.5. Vemund