From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4875 invoked by alias); 7 Aug 2009 13:48:46 -0000 Received: (qmail 4864 invoked by uid 22791); 7 Aug 2009 13:48:46 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_23,J_CHICKENPOX_36,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-ew0-f223.google.com (HELO mail-ew0-f223.google.com) (209.85.219.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Aug 2009 13:48:40 +0000 Received: by ewy23 with SMTP id 23so1642785ewy.8 for ; Fri, 07 Aug 2009 06:48:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.28.1 with SMTP id f1mr244625wea.112.1249652917338; Fri, 07 Aug 2009 06:48:37 -0700 (PDT) In-Reply-To: <1249605481.6071.5.camel@janis-laptop> References: <6c33472e0908061506t1791b3a6l92db9947839a42c0@mail.gmail.com> <1249605481.6071.5.camel@janis-laptop> Date: Fri, 07 Aug 2009 14:16:00 -0000 Message-ID: <6c33472e0908070648t76f08e13lfae22be7b0457a76@mail.gmail.com> Subject: Re: c-c++-common testsuite From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= To: janis187@us.ibm.com Cc: gcc Mailing List , "Joseph S. Myers" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00131.txt.bz2 2009/8/7 Janis Johnson : > On Fri, 2009-08-07 at 00:06 +0200, Manuel L=F3pez-Ib=E1=F1ez wrote: >> Often I want to test the exactly same testcase in C and C++, so I find >> myself adding duplicate tests under gcc.dg/ and g++.dg/. Would it be >> possible to have a shared testsuite dir that is run for both C and C++ >> languages? (possibly with different default configurations, like >> adding -Wc++-compat to the commandline for C runs). > > I've been thinking about that lately, it would be useful for several > kinds of functionality. =A0We'd want effective targets for the language > for using different options and for providing different error/warning > checks for each language. =A0I haven't looked into how to handle it with > DejaGnu, maybe something like gcc.shared and a [symbolic] link to it > called g++.shared; do links work with Subversion? Janis, it would be extremely useful to have dg-options that are only enabled for certain languages, so I can do /* { dg-options "-std=3Dc99" { dg-require-effective-target c } } */ /* { dg-options "" { dg-require-effective-target c++ } } */ Would this be hard to implement? Any ideas? As for how to run the shared tests, Joseph suggestion works, but I think it is better to just run the common tests from each dg.exp file Index: gcc/testsuite/gcc.dg/dg.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/testsuite/gcc.dg/dg.exp (revision 150491) +++ gcc/testsuite/gcc.dg/dg.exp (working copy) @@ -30,7 +30,11 @@ dg-init # Main loop. dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSi\]]] \ "" $DEFAULT_CFLAGS +# C/C++ common tests. +dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/*.\[cSi\]]] \ + " -Wc++-compat " "" + # All done. dg-finish Index: gcc/testsuite/g++.dg/dg.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/testsuite/g++.dg/dg.exp (revision 150491) +++ gcc/testsuite/g++.dg/dg.exp (working copy) @@ -47,7 +47,11 @@ set tests [prune $tests $srcdir/$subdir/ set tests [prune $tests $srcdir/$subdir/graphite/*] # Main loop. dg-runtest $tests "" $DEFAULT_CXXFLAGS +# C/C++ common tests. +dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/*.\[cSi\]]] \ + "" "" + # All done. dg-finish so people can run c-c++-common testcases by doing simply make -C gcc check-gcc RUNTESTFLAGS=3Ddg.exp=3D'*Wconversion*' Cheers, Manuel.