[gdb/testsuite] Handle missing gdc in gdb.dlang/dlang-start.exp
authorTom de Vries <tdevries@suse.de>
Mon, 27 Mar 2023 09:35:26 +0000 (11:35 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 27 Mar 2023 09:35:26 +0000 (11:35 +0200)
commit1770eca698ad0018cd504b9744306fc9928d9a86
treead00632dd2ee48fa592efd7091bcce62c6517f76
parent16fbc917fa85a89c733ffa896b6612333bd3b50f
[gdb/testsuite] Handle missing gdc in gdb.dlang/dlang-start.exp

On openSUSE Leap 15.4, I get:
...
Running gdb.dlang/dlang-start.exp ...
gdb compile failed, default_target_compile: Can't find gdc.
UNTESTED: gdb.dlang/dlang-start.exp: failed to prepare
...

Fix this by:
- introducing a new proc can_compile, and
- requiring "can_compile d" in the test-case,
such that I have instead:
...
Running gdb.dlang/dlang-start.exp ...
UNSUPPORTED: gdb.dlang/dlang-start.exp: require failed: can_compile d
...

Tested on x86_64-linux, on openSUSE Leap 15.4 and Fedora 37.
gdb/testsuite/gdb.dlang/dlang-start.exp
gdb/testsuite/lib/gdb.exp