[gdb/testsuite] Handle missing gccgo
authorTom de Vries <tdevries@suse.de>
Thu, 20 Feb 2020 05:31:24 +0000 (06:31 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 20 Feb 2020 05:31:24 +0000 (06:31 +0100)
commitd7445728b14851cb8535a6a9fa2995817dea2e60
tree51755ee0e9bed51d02e615df8b7590372ded75c9
parentcb54886dcb525d85aca83e3d1fe9cfcf2aa0a5fb
[gdb/testsuite] Handle missing gccgo

Without gccgo installed I see in stdout/stderr:
...
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/print.exp ...
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/handcall.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/max-depth.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/integers.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/unsafe.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/package.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/types.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/chan.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/strings.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/basic-types.exp ...
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/hello.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
Running /data/gdb_versions/devel/src/gdb/testsuite/gdb.go/methods.exp ...
gdb compile failed, default_target_compile: Can't find gccgo.
...

Fix this by introducing a gdb_caching_proc support_go_compile, and using it in
the complaining test-cases.

Tested on x86_64-linux, with and without gccgo installed.

gdb/testsuite/ChangeLog:

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

* lib/gdb.exp (support_go_compile): New gdb_caching_proc.
(gdb_simple_compile): Handle compile_flags go by using .go extension
for source file.
* gdb.go/chan.exp: Use support_go_compile.
* gdb.go/handcall.exp: Same.
* gdb.go/hello.exp: Same.
* gdb.go/integers.exp: Same.
* gdb.go/max-depth.exp: Same.
* gdb.go/methods.exp: Same.
* gdb.go/package.exp: Same.
* gdb.go/strings.exp: Same.
* gdb.go/types.exp: Same.
* gdb.go/unsafe.exp: Same.
12 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.go/chan.exp
gdb/testsuite/gdb.go/handcall.exp
gdb/testsuite/gdb.go/hello.exp
gdb/testsuite/gdb.go/integers.exp
gdb/testsuite/gdb.go/max-depth.exp
gdb/testsuite/gdb.go/methods.exp
gdb/testsuite/gdb.go/package.exp
gdb/testsuite/gdb.go/strings.exp
gdb/testsuite/gdb.go/types.exp
gdb/testsuite/gdb.go/unsafe.exp
gdb/testsuite/lib/gdb.exp