public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [FYI] Fix build breakage with --disable-tui
@ 2019-12-02 23:13 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-12-02 23:13 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

An earlier patch introduced a unit test for tui_copy_source_line.
However if the TUI is not built (as is apparently the case on some of
the buildbot builders), then this will fail to link.

This patch fixes the problem.  Tested by rebuilding with the TUI
disabled.

gdb/ChangeLog
2019-12-02  Tom Tromey  <tom@tromey.com>

	* unittests/tui-selftests.c (run_tests): Make conditional.
	(_initialize_tui_selftest): Make conditional.

Change-Id: I964811c7635be24cf6c53920e74e920914503674
---
 gdb/ChangeLog                 | 5 +++++
 gdb/unittests/tui-selftests.c | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/gdb/unittests/tui-selftests.c b/gdb/unittests/tui-selftests.c
index 3a5d34fe48c..95c12e3f5d2 100644
--- a/gdb/unittests/tui-selftests.c
+++ b/gdb/unittests/tui-selftests.c
@@ -21,6 +21,8 @@
 #include "gdbsupport/selftest.h"
 #include "tui/tui-winsource.h"
 
+#ifdef TUI
+
 namespace selftests {
 namespace tui {
 
@@ -41,8 +43,12 @@ run_tests ()
 } /* namespace tui*/
 } /* namespace selftests */
 
+#endif /* TUI */
+
 void
 _initialize_tui_selftest ()
 {
+#ifdef TUI
   selftests::register_test ("tui", selftests::tui::run_tests);
+#endif
 }
-- 
2.17.2

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-02 23:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-02 23:13 [FYI] Fix build breakage with --disable-tui Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).