summaryrefslogtreecommitdiff
path: root/lib/tdb2/wscript
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-07 22:37:52 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-07 18:53:12 +0200
commit35a2d020a0c3b0ba638874bc0cdbd215c76bf606 (patch)
treeafac33a693be2c52f32e0b69a8cb11176f38dee6 /lib/tdb2/wscript
parent4c9126daa98cd35a416f435e088943d94823e550 (diff)
downloadsamba-35a2d020a0c3b0ba638874bc0cdbd215c76bf606.tar.gz
samba-35a2d020a0c3b0ba638874bc0cdbd215c76bf606.tar.bz2
samba-35a2d020a0c3b0ba638874bc0cdbd215c76bf606.zip
ccan: Only build ccan-failtest when we are in developer mode
From: Andrew Bartlett <abartlet@samba.org> This code is incredibly useful, but is only needed in test code and may not be perfectly portable. It has compiled on all systems bar Solaris so far, but rather than make it a requirement to build Samba, just keep it for development. Andrew Bartlett Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Thu Jun 7 18:53:12 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib/tdb2/wscript')
-rw-r--r--lib/tdb2/wscript64
1 files changed, 36 insertions, 28 deletions
diff --git a/lib/tdb2/wscript b/lib/tdb2/wscript
index a1885fc3c8..b925893cb4 100644
--- a/lib/tdb2/wscript
+++ b/lib/tdb2/wscript
@@ -21,6 +21,9 @@ def set_options(opt):
opt.BUILTIN_DEFAULT('replace,ccan')
opt.PRIVATE_EXTENSION_DEFAULT('tdb2', noextension='tdb2')
opt.RECURSE('lib/replace')
+ opt.add_option('--enable-developer',
+ help=("Turn on developer warnings and debugging"),
+ action="store_true", dest='developer', default=False)
opt.add_option('--enable-tdb2',
help=("Use tdb2 API instead of tdb1 [True]"),
action="store_true", dest='BUILD_TDB2', default=True)
@@ -39,6 +42,9 @@ def set_options(opt):
action="store_true", dest='disable_python', default=False)
def configure(conf):
+ if Options.options.developer:
+ conf.env.DEVELOPER_MODE = True
+
conf.env.TEST_RUN_SRC=['test/run-001-encode.c',
'test/run-001-fls.c',
'test/run-01-new_database.c',
@@ -205,33 +211,6 @@ def build(bld):
'tools/tdb2backup.c',
deps='tdb')
- # FIXME: We need CCAN for some API tests, but waf thinks it's
- # already available via tdb2. It is, but not publicly.
- # Workaround is to build a private, non-hiding version.
- bld.SAMBA_SUBSYSTEM('tdb2-testing',
- SRC,
- deps='replace ccan',
- includes='.')
-
- bld.SAMBA_SUBSYSTEM('tdb2-test-helpers', bld.env.TEST_HELPER_SRC,
- deps='replace')
- bld.SAMBA_SUBSYSTEM('tdb2-run-helpers', bld.env.TEST_RUN_HELPER_SRC,
- deps='replace')
- bld.SAMBA_SUBSYSTEM('tdb2-api-helpers', bld.env.TEST_API_HELPER_SRC,
- deps='replace tdb2-testing')
-
- for f in bld.env.TEST_RUN_SRC:
- base = os.path.splitext(os.path.basename(f))[0]
- bld.SAMBA_BINARY('tdb2-' + base, f,
- deps='ccan replace tdb2-test-helpers tdb2-run-helpers',
- install=False)
-
- for f in bld.env.TEST_API_SRC:
- base = os.path.splitext(os.path.basename(f))[0]
- bld.SAMBA_BINARY('tdb2-' + base, f,
- deps='ccan replace tdb2-test-helpers tdb2-api-helpers',
- install=False)
-
if not bld.CONFIG_SET('USING_SYSTEM_PYTDB'):
bld.SAMBA_PYTHON('pytdb',
source='pytdb.c',
@@ -240,6 +219,34 @@ def build(bld):
realname='tdb.so',
cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
+ if bld.env.DEVELOPER_MODE:
+ # FIXME: We need CCAN for some API tests, but waf thinks it's
+ # already available via tdb2. It is, but not publicly.
+ # Workaround is to build a private, non-hiding version.
+ bld.SAMBA_SUBSYSTEM('tdb2-testing',
+ SRC,
+ deps='replace ccan',
+ includes='.')
+
+ bld.SAMBA_SUBSYSTEM('tdb2-test-helpers', bld.env.TEST_HELPER_SRC,
+ deps='replace')
+ bld.SAMBA_SUBSYSTEM('tdb2-run-helpers', bld.env.TEST_RUN_HELPER_SRC,
+ deps='replace')
+ bld.SAMBA_SUBSYSTEM('tdb2-api-helpers', bld.env.TEST_API_HELPER_SRC,
+ deps='replace tdb2-testing')
+
+ for f in bld.env.TEST_RUN_SRC:
+ base = os.path.splitext(os.path.basename(f))[0]
+ bld.SAMBA_BINARY('tdb2-' + base, f,
+ deps='ccan replace tdb2-test-helpers tdb2-run-helpers ccan-failtest',
+ install=False)
+
+ for f in bld.env.TEST_API_SRC:
+ base = os.path.splitext(os.path.basename(f))[0]
+ bld.SAMBA_BINARY('tdb2-' + base, f,
+ deps='ccan replace tdb2-test-helpers tdb2-api-helpers',
+ install=False)
+
def testonly(ctx):
'''run tdb2 testsuite'''
import Utils, samba_utils, shutil
@@ -247,7 +254,8 @@ def testonly(ctx):
env = samba_utils.LOAD_ENVIRONMENT()
- if env.BUILD_TDB2 and env.standalone_tdb2:
+ if env.BUILD_TDB2 and env.standalone_tdb2 and env.DEVELOPER_MODE:
+
# FIXME: This is horrible :(
test_prefix = "%s/st" % (Utils.g_module.blddir)
shutil.rmtree(test_prefix, ignore_errors=True)