Blame SOURCES/0002-ldb-Run-at-least-some-tests-on-32-bit-machines.patch

5fb18d
From 04e74153057d34b5dbdbc03f47d7684b4d4c1093 Mon Sep 17 00:00:00 2001
5fb18d
From: Lukas Slebodnik <lslebodn@fedoraproject.org>
5fb18d
Date: Wed, 30 May 2018 23:22:40 +0200
5fb18d
Subject: [PATCH] ldb: Run at least some tests on 32 bit machines
5fb18d
5fb18d
lmdb is supported only on 64 bit machines. But there also
5fb18d
unit tests which pass just with tdb on 32 bit architectures.
5fb18d
5fb18d
Signed-off-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
5fb18d
---
5fb18d
 lib/ldb/wscript | 19 +++++++++++--------
5fb18d
 1 file changed, 11 insertions(+), 8 deletions(-)
5fb18d
5fb18d
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
5fb18d
index f5cb1e0ab28dc01e5b031c7c290bed26c7007676..03279772557284d96f5b8c81ed4a8513e5c65f17 100644
5fb18d
--- a/lib/ldb/wscript
5fb18d
+++ b/lib/ldb/wscript
5fb18d
@@ -518,10 +518,6 @@ def test(ctx):
5fb18d
     env = samba_utils.LOAD_ENVIRONMENT()
5fb18d
     ctx.env = env
5fb18d
 
5fb18d
-    if not env.HAVE_LMDB:
5fb18d
-        raise Utils.WafError('make test called, but ldb was built '
5fb18d
-                             '--without-ldb-lmdb')
5fb18d
-
5fb18d
     test_prefix = "%s/st" % (Utils.g_module.blddir)
5fb18d
     shutil.rmtree(test_prefix, ignore_errors=True)
5fb18d
     os.makedirs(test_prefix)
5fb18d
@@ -537,9 +533,13 @@ def test(ctx):
5fb18d
     tmp_dir = os.path.join(test_prefix, 'tmp')
5fb18d
     if not os.path.exists(tmp_dir):
5fb18d
         os.mkdir(tmp_dir)
5fb18d
-    pyret = samba_utils.RUN_PYTHON_TESTS(
5fb18d
-        ['tests/python/api.py', 'tests/python/index.py'],
5fb18d
-        extra_env={'SELFTEST_PREFIX': test_prefix})
5fb18d
+
5fb18d
+    if env.HAVE_LMDB:
5fb18d
+        pyret = samba_utils.RUN_PYTHON_TESTS(
5fb18d
+            ['tests/python/api.py', 'tests/python/index.py'],
5fb18d
+            extra_env={'SELFTEST_PREFIX': test_prefix})
5fb18d
+    else:
5fb18d
+        pyret = 0
5fb18d
     print("Python testsuite returned %d" % pyret)
5fb18d
 
5fb18d
     cmocka_ret = 0
5fb18d
@@ -549,7 +549,10 @@ def test(ctx):
5fb18d
                  'ldb_tdb_guid_mod_op_test',
5fb18d
                  'ldb_msg_test',
5fb18d
                  'ldb_tdb_kv_ops_test',
5fb18d
-                 'ldb_tdb_test',
5fb18d
+                 'ldb_tdb_test']
5fb18d
+
5fb18d
+    if env.HAVE_LMDB:
5fb18d
+        test_exes += [
5fb18d
                  'ldb_mdb_mod_op_test',
5fb18d
                  'ldb_lmdb_test',
5fb18d
                  # we don't want to run ldb_lmdb_size_test (which proves we can
5fb18d
-- 
5fb18d
2.17.0
5fb18d