diff mbox

[gdb/testsuite] Add unsupported tests in catch_ex_std.exp

Message ID 20200213090332.GA7575@delia
State New
Headers show

Commit Message

Tom de Vries Feb. 13, 2020, 9:03 a.m. UTC
Hi,

If I de-install gnatbind, I run into:
...
FAIL: gdb.ada/catch_ex_std.exp: gnatbind foo
...

Fix this by marking the test unsupported instead:
...
UNSUPPORTED: gdb.ada/catch_ex_std.exp: gnatbind foo
...

Likewise for gnatlink.

Tested on x86_64-linux, with and without gnatbind/gnatlink installed.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Add unsupported tests in catch_ex_std.exp

gdb/testsuite/ChangeLog:

2020-02-13  Tom de Vries  <tdevries@suse.de>

	* gdb.ada/catch_ex_std.exp: Indicate unsupported if gnatbind/gnatlink
	are missing.

---
 gdb/testsuite/gdb.ada/catch_ex_std.exp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Tom Tromey Feb. 13, 2020, 2:20 p.m. UTC | #1
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> 2020-02-13  Tom de Vries  <tdevries@suse.de>

Tom> 	* gdb.ada/catch_ex_std.exp: Indicate unsupported if gnatbind/gnatlink
Tom> 	are missing.

Thanks, this is ok.

Tom
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp
index e6943ab395..3fae34008f 100644
--- a/gdb/testsuite/gdb.ada/catch_ex_std.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp
@@ -59,6 +59,12 @@  set gnatbind [find_ada_tool gnatbind]
 set gnatlink [find_ada_tool gnatlink]
 
 with_cwd $outdir {
+    # Test if gnatbind is supported
+    set status [remote_exec host "$gnatbind --version"]
+    if {[lindex $status 0] == -1} {
+	unsupported "gnatbind foo"
+	return -1
+    }
     # Bind.
     set status [remote_exec host "$gnatbind -shared foo"]
     if {[lindex $status 0] == 0} {
@@ -68,6 +74,12 @@  with_cwd $outdir {
 	return -1
     }
 
+    # Test if gnatlink is supported
+    set status [remote_exec host "$gnatlink --version"]
+    if {[lindex $status 0] == -1} {
+	unsupported "gnatlink foo"
+	return -1
+    }
     # Finally, link.
     if {[istarget "*-*-mingw*"]
 	|| [istarget *-*-cygwin*]