diff mbox

[OBV] Skip parse_memory_map_tests if XML is disabled

Message ID 1513334661-31215-1-git-send-email-yao.qi@linaro.org
State New
Headers show

Commit Message

Yao Qi Dec. 15, 2017, 10:44 a.m. UTC
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

I'll push it in.

gdb:

2017-12-15  Yao Qi  <yao.qi@linaro.org>

	* unittests/memory-map-selftests.c: Wrap test with HAVE_LIBEXPAT.

---
 gdb/ChangeLog                        | 4 ++++
 gdb/unittests/memory-map-selftests.c | 6 ++++++
 2 files changed, 10 insertions(+)
diff mbox

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 83a014a..292929d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2017-12-15  Yao Qi  <yao.qi@linaro.org>
+
+	* unittests/memory-map-selftests.c: Wrap test with HAVE_LIBEXPAT.
+
 2017-12-15  Xavier Roirand  <roirand@adacore.com>
 
 	* ada-lang.c (ada_value_primitive_field): Handle field search
diff --git a/gdb/unittests/memory-map-selftests.c b/gdb/unittests/memory-map-selftests.c
index 3b282b5..618a1e9 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
 }