]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-build: Separate test backtrace support into separate subsystem
authorMartin Schwenke <martin@meltin.net>
Tue, 3 May 2022 23:02:12 +0000 (09:02 +1000)
committerMartin Schwenke <martins@samba.org>
Thu, 28 Jul 2022 10:09:34 +0000 (10:09 +0000)
A convention when testing members of ctdb-util is to include the .c
file so that static functions can potentially be tested.  This means
that such tests can't be linked against ctdb-util or duplicate symbols
will be encountered.

ctdb-tests-common depends on ctdb-client, which depends in turn on
ctdb-util, so this can't be used to pull in backtrace support.
Instead, make ctdb-tests-backtrace its own subsystem.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/wscript

index 4a31944e86567ef323d71600c58cf30f9dcfb5c3..d56655da4bc6d441a3056b9419c2371e76380754 100644 (file)
@@ -956,7 +956,7 @@ def build(bld):
 
     bld.SAMBA_BINARY('system_socket_test',
                      source='tests/src/system_socket_test.c',
-                     deps='''ctdb-tests-common
+                     deps='''ctdb-tests-backtrace
                              talloc
                              ctdb-protocol-util
                              pcap
@@ -1030,7 +1030,6 @@ def build(bld):
                         source=bld.SUBDIR('tests/src',
                                           '''cluster_wait.c
                                              test_options.c
-                                             test_backtrace.c
                                           '''),
                         deps='''ctdb-client
                                 samba-util
@@ -1040,6 +1039,12 @@ def build(bld):
                                 tevent
                                 tdb''')
 
+    bld.SAMBA_SUBSYSTEM('ctdb-tests-backtrace',
+                        source=bld.SUBDIR('tests/src',
+                                          'test_backtrace.c'),
+                        deps='''samba-util
+                                replace''')
+
     # Test binaries
     ctdb_tests = [
         'g_lock_loop',
@@ -1087,7 +1092,7 @@ def build(bld):
 
     bld.SAMBA_BINARY('cluster_mutex_test',
                      source='tests/src/cluster_mutex_test.c',
-                     deps='''ctdb-tests-common
+                     deps='''ctdb-tests-backtrace
                              samba-util
                              talloc
                              tevent