[SCM] Samba Shared Repository - branch master updated

Rusty Russell rusty at samba.org
Thu Jun 7 10:54:03 MDT 2012


The branch, master has been updated
       via  35a2d02 ccan: Only build ccan-failtest when we are in developer mode
       via  4c9126d lib/tdb2: build tests when built at toplevel.
      from  e102350 waf: fix parsing krb5-config --version for MIT krb5

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 35a2d020a0c3b0ba638874bc0cdbd215c76bf606
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Jun 7 22:37:52 2012 +0930

    ccan: Only build ccan-failtest when we are in developer mode
    
    From: Andrew Bartlett <abartlet at 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 at rustcorp.com.au>
    
    Autobuild-User(master): Rusty Russell <rusty at rustcorp.com.au>
    Autobuild-Date(master): Thu Jun  7 18:53:12 CEST 2012 on sn-devel-104

commit 4c9126daa98cd35a416f435e088943d94823e550
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Thu Jun 7 22:24:07 2012 +0930

    lib/tdb2: build tests when built at toplevel.
    
    They weren't being built when we were at top-level, because the globs
    were wrong.  Just open-code the test names, which always works.
    
    Reported-by: Andrew Bartlett
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

-----------------------------------------------------------------------

Summary of changes:
 lib/ccan/wscript |   18 +++++-
 lib/tdb2/wscript |  161 ++++++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 134 insertions(+), 45 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ccan/wscript b/lib/ccan/wscript
index 24034bb..8a2b3e7 100644
--- a/lib/ccan/wscript
+++ b/lib/ccan/wscript
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import Logs, sys
+import Logs, sys, Options
 
 def configure(conf):
     conf.DEFINE('HAVE_CCAN', 1)
@@ -121,8 +121,18 @@ def configure(conf):
     conf.CHECK_FUNCS_IN('backtrace backtrace_symbols', 'execinfo', checklibc=True, headers='execinfo.h')
 
 def build(bld):
+
+    for ccan_dir in ["hash", "htable", "ilog", "likely", "list", "read_write_all", "str", "tally", "time"]:
+        bld.SAMBA_SUBSYSTEM('ccan-%s' % ccan_dir,
+                            source=bld.path.ant_glob('%s/*.c' % ccan_dir))
+
+    if bld.env.DEVELOPER_MODE:
+        bld.SAMBA_LIBRARY('ccan-failtest',
+                          source=bld.path.ant_glob('failtest/*.c'),
+                          deps='execinfo ccan ccan-failtest ccan-htable ccan-list ccan-read_write_all ccan-time',
+                          private_library=True)
+
     bld.SAMBA_LIBRARY('ccan',
-                      vnum="0.1-init-1161-g661d41f",
-                      source=bld.path.ant_glob('*/*.c'),
-                      deps='execinfo',
+                      source='',
+                      deps='ccan-hash ccan-ilog ccan-likely ccan-tally',
                       private_library=True)
diff --git a/lib/tdb2/wscript b/lib/tdb2/wscript
index 63d27fe..b925893 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,92 @@ 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',
+                           'test/run-02-expand.c',
+                           'test/run-03-coalesce.c',
+                           'test/run-04-basichash.c',
+                           'test/run-05-readonly-open.c',
+                           'test/run-10-simple-store.c',
+                           'test/run-11-simple-fetch.c',
+                           'test/run-12-check.c',
+                           'test/run-15-append.c',
+                           'test/run-20-growhash.c',
+                           'test/run-25-hashoverload.c',
+                           'test/run-30-exhaust-before-expand.c',
+                           'test/run-35-convert.c',
+                           'test/run-50-multiple-freelists.c',
+                           'test/run-56-open-during-transaction.c',
+                           'test/run-57-die-during-transaction.c',
+                           'test/run-64-bit-tdb.c',
+                           'test/run-90-get-set-attributes.c',
+                           'test/run-capabilities.c',
+                           'test/run-expand-in-transaction.c',
+                           'test/run-features.c',
+                           'test/run-lockall.c',
+                           'test/run-remap-in-read_traverse.c',
+                           'test/run-seed.c',
+                           'test/run-tdb1-3G-file.c',
+                           'test/run-tdb1-bad-tdb-header.c',
+                           'test/run-tdb1.c',
+                           'test/run-tdb1-check.c',
+                           'test/run-tdb1-corrupt.c',
+                           'test/run-tdb1-endian.c',
+                           'test/run-tdb1-hashsize.c',
+                           'test/run-tdb1-incompatible.c',
+                           'test/run-tdb1-nested-transactions.c',
+                           'test/run-tdb1-nested-traverse.c',
+                           'test/run-tdb1-no-lock-during-traverse.c',
+                           'test/run-tdb1-oldhash.c',
+                           'test/run-tdb1-readonly-check.c',
+                           'test/run-tdb1-rwlock-check.c',
+                           'test/run-tdb1-seqnum-wrap.c',
+                           'test/run-tdb1-summary.c',
+                           'test/run-tdb1-traverse-in-transaction.c',
+                           'test/run-tdb1-wronghash-fail.c',
+                           'test/run-tdb1-zero-append.c',
+                           'test/run-tdb_errorstr.c',
+                           'test/run-tdb_foreach.c',
+                           'test/run-traverse.c']
+    conf.env.TEST_API_SRC=['test/api-12-store.c',
+                           'test/api-13-delete.c',
+                           'test/api-14-exists.c',
+                           'test/api-16-wipe_all.c',
+                           'test/api-21-parse_record.c',
+                           'test/api-55-transaction.c',
+                           'test/api-80-tdb_fd.c',
+                           'test/api-81-seqnum.c',
+                           'test/api-82-lockattr.c',
+                           'test/api-83-openhook.c',
+                           'test/api-91-get-stats.c',
+                           'test/api-92-get-set-readonly.c',
+                           'test/api-93-repack.c',
+                           'test/api-add-remove-flags.c',
+                           'test/api-check-callback.c',
+                           'test/api-firstkey-nextkey.c',
+                           'test/api-fork-test.c',
+                           'test/api-locktimeout.c',
+                           'test/api-missing-entries.c',
+                           'test/api-open-multiple-times.c',
+                           'test/api-record-expand.c',
+                           'test/api-simple-delete.c',
+                           'test/api-summary.c',
+                           'test/api-tdb1-flag-removal.c']
+    conf.env.TEST_API_HELPER_SRC=['test/helpapi-external-agent.c']
+    conf.env.TEST_RUN_HELPER_SRC=['test/helprun-external-agent.c',
+                                  'test/helprun-layout.c']
+    conf.env.TEST_HELPER_SRC=['test/external-agent.c',
+                              'test/failtest_helper.c',
+                              'test/lock-tracking.c',
+                              'test/logging.c',
+                              'test/tap-interface.c',
+                              'test/tdb1-external-agent.c',
+                              'test/tdb1-lock-tracking.c']
+
     if Options.options.BUILD_TDB2:
         conf.DEFINE('BUILD_TDB2', 1)
         conf.RECURSE('lib/replace')
@@ -69,18 +158,6 @@ def configure(conf):
 
         conf.SAMBA_CONFIG_H()
 
-        # Seems like env can't contain sets?
-        conf.env.tdb2_test = {}
-        conf.env.tdb2_test['run'] = glob.glob('test/run*.c')
-        conf.env.tdb2_test['api'] = glob.glob('test/api*.c')
-        conf.env.tdb2_test['runhelper'] = glob.glob('test/helprun*.c')
-        conf.env.tdb2_test['apihelper'] = glob.glob('test/helpapi*.c')
-        conf.env.tdb2_test['helper'] = list(set(glob.glob('test/*.c'))
-                                            - set(conf.env.tdb2_test['run'])
-                                            - set(conf.env.tdb2_test['api'])
-                                            - set(conf.env.tdb2_test['runhelper'])
-                                            - set(conf.env.tdb2_test['apihelper']))
-
 def build(bld):
     if bld.env.BUILD_TDB2:
         bld.RECURSE('lib/replace')
@@ -134,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 tdb.  It is, but not publicly.
-            # Workaround is to build a private, non-hiding version.
-            bld.SAMBA_SUBSYSTEM('tdb-testing',
-                                SRC,
-                                deps='replace ccan',
-                                includes='.')
-
-            bld.SAMBA_SUBSYSTEM('tdb2-test-helpers',
-                                bld.env.tdb2_test['helper'], deps='replace')
-            bld.SAMBA_SUBSYSTEM('tdb2-run-helpers',
-                                bld.env.tdb2_test['runhelper'], deps='replace')
-            bld.SAMBA_SUBSYSTEM('tdb2-api-helpers',
-                                bld.env.tdb2_test['apihelper'], deps='replace tdb-testing')
-
-            for f in bld.env.tdb2_test['run']:
-                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.tdb2_test['api']:
-                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',
@@ -169,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
@@ -176,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)
@@ -195,7 +274,7 @@ def testonly(ctx):
         if Options.options.VALGRINDLOG is not None:
             os.environ['VALGRIND'] += ' --log-file=%s' % Options.options.VALGRINDLOG
 
-        for f in env.tdb2_test['run'] + env.tdb2_test['api']:
+        for f in env.TEST_RUN_SRC + env.TEST_API_SRC:
             name = "tdb2-" + os.path.splitext(os.path.basename(f))[0]
             cmd = "cd " + testdir + " && $VALGRIND " + os.path.abspath(os.path.join(Utils.g_module.blddir, name)) + " > test-output 2>&1"
             print("..." + f)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list