From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA/testsuite/ada] Do not abort prematurely the test upon build failure
Date: Thu, 01 Apr 2004 02:30:00 -0000 [thread overview]
Message-ID: <20040401023006.GL888@gnat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1876 bytes --]
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 <bla bla bla>] != "" } {
!! -> 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 <brobecker@gnat.com>
* 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
[-- Attachment #2: null_record.exp.diff --]
[-- Type: text/plain, Size: 587 bytes --]
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
next reply other threads:[~2004-04-01 2:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-01 2:30 Joel Brobecker [this message]
2004-04-01 4:02 ` Daniel Jacobowitz
2004-04-01 6:18 ` Joel Brobecker
2004-04-01 15:08 ` Daniel Jacobowitz
2004-04-01 17:49 ` Joel Brobecker
2004-04-02 16:28 ` Andrew Cagney
2004-04-02 17:30 Michael Elizabeth Chastain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040401023006.GL888@gnat.com \
--to=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox