aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2018-01-08 10:09:33 +0000
committerYao Qi <yao.qi@linaro.org>2018-01-08 10:09:33 +0000
commit605fd3c6590fbed834107a2e1d1df0ba58834576 (patch)
treea7b77c29951580a3502087939627b9c23b7aa323 /gdb/testsuite
parent1e5ded6ce688ddee065fa852053dda07fcce959e (diff)
downloadgdb-605fd3c6590fbed834107a2e1d1df0ba58834576.zip
gdb-605fd3c6590fbed834107a2e1d1df0ba58834576.tar.gz
gdb-605fd3c6590fbed834107a2e1d1df0ba58834576.tar.bz2
Fix GDBserver build failure when $development is false
When we set bfd/development.sh:$development to false, GDBserver failed to build, selftest.o: In function `selftests::run_tests(char const*)': binutils-gdb/gdb/gdbserver/../common/selftest.c:97:undefined reference to `selftests::reset()' collect2: error: ld returned 1 exit status selftest.o shouldn't be compiled and linked when $development is false. With this patch, in release mode, GDBserver doesn't nothing with option --selftest, $ ./gdbserver --selftest=foo Selftests are not available in a non-development build. $ ./gdbserver --selftest Selftests are not available in a non-development build. gdb/gdbserver: 2018-01-08 Yao Qi <yao.qi@linaro.org> Simon Marchi <simon.marchi@ericsson.com> * Makefile.in (OBS): Remove selftest.o. * configure.ac: Set srv_selftest_objs if $development is true. (GDBSERVER_DEPFILES): Append $srv_selftest_objs. * configure: Re-generated. * server.c (captured_main): Wrap variable selftest_filter with GDB_SELF_TEST. gdb/testsuite: 2018-01-08 Simon Marchi <simon.marchi@ericsson.com> * gdb.server/unittest.exp: Match the output in non-development mode.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.server/unittest.exp13
2 files changed, 15 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c1223db..71424a9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2018-01-08 Simon Marchi <simon.marchi@ericsson.com>
+ * gdb.server/unittest.exp: Match the output in non-development
+ mode.
+
+2018-01-08 Simon Marchi <simon.marchi@ericsson.com>
+
* gdb.gdb/unittest.exp: Match output in non-development mode.
2018-01-08 Joel Brobecker <brobecker@adacore.com>
diff --git a/gdb/testsuite/gdb.server/unittest.exp b/gdb/testsuite/gdb.server/unittest.exp
index 646babc..e947ff2 100644
--- a/gdb/testsuite/gdb.server/unittest.exp
+++ b/gdb/testsuite/gdb.server/unittest.exp
@@ -30,12 +30,19 @@ set gdbserver_command "$gdbserver --selftest"
set server_spawn_id [remote_spawn target $gdbserver_command]
+set test "unit tests"
gdb_expect {
-i $server_spawn_id
- -re "Ran $decimal unit tests, 0 failed" {
- pass "unit tests"
+ -re "Ran ($decimal) unit tests, 0 failed" {
+ set num_ran $expect_out(1,string)
+ gdb_assert "$num_ran > 0" $test
}
+
+ -re "Selftests are not available in a non-development build.\r\n$" {
+ unsupported $test
+ }
+
default {
- fail "unit tests"
+ fail $test
}
}