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.
This commit is contained in:
Yao Qi 2017-12-15 10:45:27 +00:00
parent fbc2255575
commit 97d4fac10f
2 changed files with 10 additions and 0 deletions

View File

@ -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> 2017-12-15 Xavier Roirand <roirand@adacore.com>
* ada-lang.c (ada_value_primitive_field): Handle field search * ada-lang.c (ada_value_primitive_field): Handle field search

View File

@ -21,6 +21,8 @@
#include "selftest.h" #include "selftest.h"
#include "memory-map.h" #include "memory-map.h"
#if defined(HAVE_LIBEXPAT)
namespace selftests { namespace selftests {
namespace memory_map_tests { namespace memory_map_tests {
@ -72,10 +74,14 @@ parse_memory_map_tests ()
} /* namespace memory_map_tests */ } /* namespace memory_map_tests */
} /* namespace selftests */ } /* namespace selftests */
#endif /* HAVE_LIBEXPAT */
void void
_initialize_memory_map_selftests () _initialize_memory_map_selftests ()
{ {
#if defined(HAVE_LIBEXPAT)
selftests::register_test selftests::register_test
("parse_memory_map", ("parse_memory_map",
selftests::memory_map_tests::parse_memory_map_tests); selftests::memory_map_tests::parse_memory_map_tests);
#endif
} }