From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 840 invoked by alias); 18 Oct 2007 16:16:15 -0000 Received: (qmail 824 invoked by uid 22791); 18 Oct 2007 16:16:14 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 18 Oct 2007 16:16:12 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.1) with ESMTP id l9IGGAKw024361 for ; Thu, 18 Oct 2007 12:16:10 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l9IGG9YS025411 for ; Thu, 18 Oct 2007 12:16:09 -0400 Received: from [172.16.57.153] (multics.rdu.redhat.com [172.16.57.153]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l9IGG9eG021376 for ; Thu, 18 Oct 2007 12:16:09 -0400 Subject: Re: generating type tests From: Stan Cox To: Frysk List In-Reply-To: <47139B3A.3000101@redhat.com> References: <1192223570.2947.145.camel@multics.rdu.redhat.com> <47139B3A.3000101@redhat.com> Content-Type: text/plain Date: Thu, 18 Oct 2007 16:16:00 -0000 Message-Id: <1192723754.2947.284.camel@multics.rdu.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-2.fc7) Content-Transfer-Encoding: 7bit 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: 2007-q4/txt/msg00065.txt.bz2 I think this reworking implements the contract we discussed in the meeting. gen-type-funit-tests.py builds funit-type-expect.c with type annotations of the form: // Test: // Name: // Value: // Type: // EType: gen-type-expect-tests.py builds TestTypeEntry*.java from, for example funit-type-expect.c, using the type annotations. Multiple files can be given so types can be specified standalone outside of the gen-type-funit-tests.py framework. This will result in TestTypeEntry*.java having the form: public void testScalar () { Expect [] expect = {...} ExpectTest expectTest = new ExpectTest("funit-type-entry"); expectTest.compareEqual(expect, "testScalar "); } // testArray/testStruct/testEnum, all generated by // gen-type-funit-tests.py public void testAlpha () { Expect [] expect = { new Expect("char_var","char"), } ExpectTest expectTest = new ExpectTest("x"); expectTest.compareEqual(expect, "testScalar "); } testAlpha is generated from x.c via: gen-type-expect-tests.py -type funit-type-entry.c x.c from this x.c: // Test: Alpha static char char_var = 176; // Name: char_var // Value: 176 // Type: char main (int argc, char **argv) {} The "Type" testing passes for those types currently being generated by gen-type-funit*. Here is a run of TestRunner done with the assistance of some makefile surgery. Running testScalar(frysk.debuginfo.TestTypeEntry) PASS Running testArray(frysk.debuginfo.TestTypeEntry) PASS Running testStruct(frysk.debuginfo.TestTypeEntry) PASS Running testEnum(frysk.debuginfo.TestTypeEntry) PASS Time: 0.21 OK (4 tests)