From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28042 invoked by alias); 1 Apr 2004 02:30:12 -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 27264 invoked from network); 1 Apr 2004 02:30:08 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 1 Apr 2004 02:30:08 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 063CA47D62; Wed, 31 Mar 2004 18:30:07 -0800 (PST) Date: Thu, 01 Apr 2004 02:30:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA/testsuite/ada] Do not abort prematurely the test upon build failure Message-ID: <20040401023006.GL888@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cGfB/trNgB3WtPHu" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2004-04/txt/msg00011.txt.bz2 --cGfB/trNgB3WtPHu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1876 I was triple checking that I fail gracefully if we don't find any gnatmake program when running our new ada tescase, and that part seems fine. But, on the contrary, I think we're being perhaps a little too silent. Right now, if you don't run the null_record.exp testcase with -v, the entire test gets skipped without any message (ie no compilation error message, no pass, no fail). With -v, we get: << Ada compilation failed: default_target_compile: Can't find gnatmake. >> That's because in null_record.exp, I have put: if {[gdb_compile_ada ] != "" } { !! -> return -1 } So indeed, when gdb_compile_ada fails, I simply abort the test... A bit too extreme, maybe? :-). Anyway, I looked at various tests in the gdb.base and gdb.cp subdirectory, and found that the common thing to do something like this: gdb_suppress_entire_file "Testcase compile failed, [...]" Here is the output (not very pretty, but oh well) I get after using this procedure, instead of returning prematurely: << WARNING: Testcase compile failed, so all tests in this file will automatically fail. ERROR: (timeout) GDB never initialized after 10 seconds. WARNING: remote_expect statement without a default case?! ERROR: couldn't load /home/brobecke/act/gdb-public/gdb/testsuite/gdb.ada/null_record into /home/brobecke/act/gdb-public/gdb/testsuite/../../gdb/gdb (end of file). FAIL: gdb.ada/null_record.exp: ptype on null record >> Note that the logs still do not contain the reason for the failure. The reason is only printed if I run the testcase with -v. 2004-03-31 Joel Brobecker * gdb.ada/null_record.exp: Do not abort the test prematurely if the build of the example program failed. Report a warning and automatically fail the tests in that file. Tested on x86-linux. OK to apply? Thanks, -- Joel --cGfB/trNgB3WtPHu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="null_record.exp.diff" Content-length: 587 Index: null_record.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/null_record.exp,v retrieving revision 1.1 diff -u -r1.1 null_record.exp --- null_record.exp 1 Apr 2004 00:57:59 -0000 1.1 +++ null_record.exp 1 Apr 2004 02:28:30 -0000 @@ -9,7 +9,7 @@ set binfile ${objdir}/${subdir}/${testfile} if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } { - return -1 + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } gdb_exit --cGfB/trNgB3WtPHu--