Fix build breakage with --disable-tui
authorTom Tromey <tom@tromey.com>
Mon, 2 Dec 2019 23:12:19 +0000 (16:12 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 2 Dec 2019 23:12:19 +0000 (16:12 -0700)
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
gdb/unittests/tui-selftests.c

index 0c31ddd1d385bf4cd6920eb26de18e7067c530c4..59825d3268fc28017490185c3543681f58507001 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-02  Tom Tromey  <tom@tromey.com>
+
+       * unittests/tui-selftests.c (run_tests): Make conditional.
+       (_initialize_tui_selftest): Make conditional.
+
 2019-12-02  Christian Biesinger  <cbiesinger@google.com>
 
        * aix-thread.c (debug_aix_thread): Change type to bool.
index 3a5d34fe48cca13baf2ce50c0efe270845d3e3c7..95c12e3f5d21d58e94155ca1c3ed0878805a866f 100644 (file)
@@ -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
 }
This page took 0.030344 seconds and 4 git commands to generate.