summaryrefslogtreecommitdiff
path: root/gdb/unittests
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-12-15 10:45:27 +0000
committerYao Qi <yao.qi@linaro.org>2017-12-15 10:45:27 +0000
commit97d4fac10fb9dac465d1d7e7a26c6b9cfb0b1326 (patch)
tree15f1a78700e94dc3ccb4f7b00ec3acbd41b356f4 /gdb/unittests
parentfbc2255575afc0d332b28fd4991235e020cda667 (diff)
Skip parse_memory_map_tests if XML is disabled
I find a fail in gdb unit test when gdb is configured without XML support. warning: Can not parse XML memory map; XML support was disabled at compile time^M Self test failed: self-test failed at ../../binutils-gdb/gdb/unittests/memory-map-selftests.c:65 ... Ran 31 unit tests, 1 failed^M (gdb) FAIL: gdb.gdb/unittest.exp: maintenance selftest gdb: 2017-12-15 Yao Qi <yao.qi@linaro.org> * unittests/memory-map-selftests.c: Wrap test with HAVE_LIBEXPAT.
Diffstat (limited to 'gdb/unittests')
-rw-r--r--gdb/unittests/memory-map-selftests.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/unittests/memory-map-selftests.c b/gdb/unittests/memory-map-selftests.c
index 3b282b5554..618a1e9c40 100644
--- a/gdb/unittests/memory-map-selftests.c
+++ b/gdb/unittests/memory-map-selftests.c
@@ -21,6 +21,8 @@
#include "selftest.h"
#include "memory-map.h"
+#if defined(HAVE_LIBEXPAT)
+
namespace selftests {
namespace memory_map_tests {
@@ -72,10 +74,14 @@ parse_memory_map_tests ()
} /* namespace memory_map_tests */
} /* namespace selftests */
+#endif /* HAVE_LIBEXPAT */
+
void
_initialize_memory_map_selftests ()
{
+#if defined(HAVE_LIBEXPAT)
selftests::register_test
("parse_memory_map",
selftests::memory_map_tests::parse_memory_map_tests);
+#endif
}