From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2086 invoked by alias); 1 Dec 2004 03:20:37 -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 2055 invoked from network); 1 Dec 2004 03:20:28 -0000 Received: from unknown (HELO priv-edtnes46.telusplanet.net) (199.185.220.240) by sourceware.org with SMTP; 1 Dec 2004 03:20:28 -0000 Received: from takamaka.act-europe.fr ([142.179.108.108]) by priv-edtnes46.telusplanet.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20041201032027.SNDK5494.priv-edtnes46.telusplanet.net@takamaka.act-europe.fr>; Tue, 30 Nov 2004 20:20:27 -0700 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id C92B047DA6; Tue, 30 Nov 2004 19:20:21 -0800 (PST) Date: Wed, 01 Dec 2004 03:20:00 -0000 From: Joel Brobecker To: Michael Elizabeth Chastain Cc: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [RFA/testsuite/ada] Put testcase code in own directory Message-ID: <20041201032021.GG1204@adacore.com> References: <20041108211630.GD649@gnat.com> <41939655.7070503@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41939655.7070503@gnu.org> User-Agent: Mutt/1.4i X-SW-Source: 2004-12/txt/msg00003.txt.bz2 Michael, > 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? :-) In reviewing this patch, I see that there are some pieces that I forgot to include. So the patch can not be accepted as is. However, would you mind telling us what you think about the principle? If you want my opinion, I am strongly attached to the idea of having one subdirectory per testcase. The current approach used for C where you can pretty much always have all the code for one testcase stored in one .c file simply does not work for Ada. With GNAT, you need the filename to match the name of the unit, and you need to have one and only one unit per file[1]. Most testcases will involve at least 3 files, one containing the main procedure (that one compilation unit), plus a .ads file containing the spec of a package, plus a .adb file containing the body of a package. Some testcases will use many more files than this (we have one testcase internally that creates something like 200 packages). For maintenance reasons, I really feel that one subdirectory per testcase is the way to go. I hope you'll agree with me, in which case I'll work on producing a new iteration of this patch, complete this time. > >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. Thanks, -- Joel [1]: This rule can actually be worked around with GNAT, by using gnatchop. What you do then is storing all the code in one file, and then let gnatchop parse it and cut it into files that follow the GNAT convention. I don't like this approach, though. One of the problems is that it is suboptimal in terms of efficiency, since you end up parsing the entire code to split it every time you run the testcase. It's just better to have then already splitted. It's also easier to track the changes in individual files rather than one bigger file. And also, we might override during the split other files created during previous testcase runs. Very annoying to have the wrong code when you come back after en entire testsuite run and try to understand why a given test failed.