From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11464 invoked by alias); 11 Nov 2004 16:43:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11055 invoked from network); 11 Nov 2004 16:43:16 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 11 Nov 2004 16:43:16 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iABGhAZh002421 for ; Thu, 11 Nov 2004 11:43:10 -0500 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iABGhAr31136; Thu, 11 Nov 2004 11:43:10 -0500 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 7BE80129D8C; Thu, 11 Nov 2004 11:41:59 -0500 (EST) Message-ID: <41939655.7070503@gnu.org> Date: Thu, 11 Nov 2004 16:43:00 -0000 From: Andrew Cagney User-Agent: Mozilla Thunderbird 0.8 (X11/20041020) MIME-Version: 1.0 To: Joel Brobecker , Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/testsuite/ada] Put testcase code in own directory References: <20041108211630.GD649@gnat.com> In-Reply-To: <20041108211630.GD649@gnat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-11/txt/msg00229.txt.bz2 Joel, nothing for or against this. However it's strategic decision - one for MichaelC - should for package like languages such as ada (and for that matter java) we have a directory per test? :-) Andrew Joel Brobecker wrote: > Hello, > > This implements something I have been thinking about doing for > a little while. The idea is have the code for each testcase be > in its own subdirectory. For instance, this change moves the code > for null_record.exp to the null_record/ subdir. > > The reason for this is to avoid name clashes. It is much more common > in Ada to split the code between several compilation units. The model > used in C where you usually have one .c file per testcase doesn't > apply well to Ada. > > The framework I'm trying to implement is that we would have one > .exp file named .exp, and have the sources located in > subdir /. > > 2004-11-08 Joel Brobecker > > * gdb.ada/gnat_ada.gpr: New file. > * gdb.ada/gnat_ada.gin: Delete, no longer used. > * lib/ada.exp (gdb_compile_ada): Minor adaptation to new project file. > * configure.in: No longer generate gnat_ada.gpr. > * gdb.ada/Makefile.in: Minor adaptation due to new project file. > * gdb.ada/null_record.exp (testfile): executable is now in > null_record subdirectory. > (srcfile): Use full path to the main compilation unit. > > Tested on x86-linux. > > OK to apply? > > Thanks, > > > ------------------------------------------------------------------------ > > -- Copyright 2004 Free Software Foundation, Inc. > -- > -- This program is free software; you can redistribute it and/or modify > -- it under the terms of the GNU General Public License as published by > -- the Free Software Foundation; either version 2 of the License, or > -- (at your option) any later version. > -- > -- This program is distributed in the hope that it will be useful, > -- but WITHOUT ANY WARRANTY; without even the implied warranty of > -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > -- GNU General Public License for more details. > -- > -- You should have received a copy of the GNU General Public License > -- along with this program; if not, write to the Free Software > -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. > > -- This project file allows us to control the location where the > -- compilation artifacts produced when building the Ada examples > -- are stored. > > project Gnat_Ada is > > for Source_Dirs use (external ("SRC")); > for Object_Dir use external ("OBJ"); > > end Gnat_Ada; > > > ------------------------------------------------------------------------ > > Index: lib/ada.exp > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/lib/ada.exp,v > retrieving revision 1.3 > diff -u -p -r1.3 ada.exp > --- lib/ada.exp 1 Apr 2004 18:42:08 -0000 1.3 > +++ lib/ada.exp 8 Nov 2004 20:47:47 -0000 > @@ -409,12 +409,16 @@ if {[info procs find_gnatmake] == ""} { > > proc gdb_compile_ada {source dest type options} { > > + set srcdir [file dirname $source] > + set gprdir [file dirname $srcdir] > set objdir [file dirname $dest] > > append options " ada" > - append options " additional_flags=-P$objdir/gnat_ada" > + append options " additional_flags=-P$gprdir/gnat_ada" > + append options " additional_flags=-XSRC=[file tail $srcdir]" > + append options " additional_flags=-XOBJ=$objdir" > > - set result [target_compile $source $dest $type $options] > + set result [target_compile [file tail $source] $dest $type $options] > > # The Ada build always produces some output, even when the build > # succeeds. Thus, we can not use the output the same way we do in > Index: configure.in > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/configure.in,v > retrieving revision 1.17 > diff -u -p -r1.17 configure.in > --- configure.in 12 Oct 2004 14:41:42 -0000 1.17 > +++ configure.in 8 Nov 2004 20:40:54 -0000 > @@ -119,7 +119,7 @@ AC_EXEEXT > > AC_CONFIG_SUBDIRS($configdirs) > AC_OUTPUT([Makefile \ > - gdb.ada/Makefile gdb.ada/gnat_ada.gpr:gdb.ada/gnat_ada.gin \ > + gdb.ada/Makefile \ > gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ > gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ > gdb.fortran/Makefile gdb.java/Makefile gdb.mi/Makefile \ > Index: gdb.ada/Makefile.in > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/Makefile.in,v > retrieving revision 1.1 > diff -u -p -r1.1 Makefile.in > --- gdb.ada/Makefile.in 1 Apr 2004 00:53:50 -0000 1.1 > +++ gdb.ada/Makefile.in 8 Nov 2004 20:40:55 -0000 > @@ -1,7 +1,7 @@ > VPATH = @srcdir@ > srcdir = @srcdir@ > > -EXECUTABLES = null_record > +EXECUTABLES = null_record/null_record > > MISCELLANEOUS = > > @@ -9,13 +9,15 @@ all info install-info dvi install uninst > @echo "Nothing to be done for $@..." > > clean mostlyclean: > - -gnatclean -Pgnat_ada -q $(EXECUTABLES) > - -rm -f *~ *.o a.out xgdb *.x *.ci *.tmp > + -find . -name '*.o' -print | xargs rm -f > + -find . -name '*.ali' -print | xargs rm -f > + -find . -name 'b~*.ad[sb]' -print | xargs rm -f > + -rm -f *~ a.out xgdb *.x *.ci *.tmp > -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES) > -rm -f $(MISCELLANEOUS) twice-tmp.c > > distclean maintainer-clean realclean: clean > -rm -f *~ core > - -rm -f Makefile config.status config.log gnat_ada.gpr > + -rm -f Makefile config.status config.log > -rm -f *-init.exp > Index: gdb.ada/null_record.exp > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/null_record.exp,v > retrieving revision 1.4 > diff -u -p -r1.4 null_record.exp > --- gdb.ada/null_record.exp 21 Oct 2004 03:55:07 -0000 1.4 > +++ gdb.ada/null_record.exp 8 Nov 2004 20:40:55 -0000 > @@ -21,8 +21,8 @@ if $tracelevel then { > > load_lib "ada.exp" > > -set testfile "null_record" > -set srcfile ${testfile}.adb > +set testfile "null_record/null_record" > +set srcfile ${srcdir}/${subdir}/${testfile}.adb > set binfile ${objdir}/${subdir}/${testfile} > > if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { > -rm -fr *.log summary detail *.plog *.sum *.psum site.*