Commit bcd83ac5 authored by Mathieu Parent's avatar Mathieu Parent

Adapt 00_Enable-make-test-even-without-lmdb.patch to current version

parent f2e80bbe
......@@ -18,7 +18,7 @@ Reviewed-by: Garming Sam <garming@catalyst.net.nz>
diff --git a/tests/ldb_no_lmdb_test.c b/tests/ldb_no_lmdb_test.c
new file mode 100644
index 00000000000..8e5a6eee8d2
index 0000000..8e5a6ee
--- /dev/null
+++ b/tests/ldb_no_lmdb_test.c
@@ -0,0 +1,158 @@
......@@ -181,10 +181,10 @@ index 00000000000..8e5a6eee8d2
+ return cmocka_run_group_tests(tests, NULL, NULL);
+}
diff --git a/tests/python/api.py b/tests/python/api.py
index e8826b5af3b..0c4e269239b 100755
index 7f53072..7446624 100755
--- a/tests/python/api.py
+++ b/tests/python/api.py
@@ -710,6 +710,8 @@ class SimpleLdb(LdbBaseTest):
@@ -707,6 +707,8 @@ class SimpleLdb(LdbBaseTest):
class SimpleLdbLmdb(SimpleLdb):
def setUp(self):
......@@ -193,10 +193,10 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
self.index = MDB_INDEX_OBJ
super(SimpleLdbLmdb, self).setUp()
@@ -718,6 +720,29 @@ class SimpleLdbLmdb(SimpleLdb):
@@ -714,6 +716,29 @@ class SimpleLdbLmdb(SimpleLdb):
def tearDown(self):
super(SimpleLdbLmdb, self).tearDown()
+class SimpleLdbNoLmdb(LdbBaseTest):
+
+ def setUp(self):
......@@ -223,7 +223,7 @@ index e8826b5af3b..0c4e269239b 100755
class SearchTests(LdbBaseTest):
def tearDown(self):
shutil.rmtree(self.testdir)
@@ -1369,6 +1394,8 @@ class SearchTests(LdbBaseTest):
@@ -1333,6 +1358,8 @@ class SearchTests(LdbBaseTest):
class SearchTestsLmdb(SearchTests):
def setUp(self):
......@@ -232,7 +232,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
self.index = MDB_INDEX_OBJ
super(SearchTestsLmdb, self).setUp()
@@ -1510,6 +1537,8 @@ class GUIDAndOneLevelIndexedSearchTests(SearchTests):
@@ -1451,6 +1478,8 @@ class GUIDAndOneLevelIndexedSearchTests(SearchTests):
class GUIDIndexedSearchTestsLmdb(GUIDIndexedSearchTests):
def setUp(self):
......@@ -241,7 +241,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
super(GUIDIndexedSearchTestsLmdb, self).setUp()
@@ -1520,6 +1549,8 @@ class GUIDIndexedSearchTestsLmdb(GUIDIndexedSearchTests):
@@ -1461,6 +1490,8 @@ class GUIDIndexedSearchTestsLmdb(GUIDIndexedSearchTests):
class GUIDIndexedDNFilterSearchTestsLmdb(GUIDIndexedDNFilterSearchTests):
def setUp(self):
......@@ -250,7 +250,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
super(GUIDIndexedDNFilterSearchTestsLmdb, self).setUp()
@@ -1530,6 +1561,8 @@ class GUIDIndexedDNFilterSearchTestsLmdb(GUIDIndexedDNFilterSearchTests):
@@ -1471,6 +1502,8 @@ class GUIDIndexedDNFilterSearchTestsLmdb(GUIDIndexedDNFilterSearchTests):
class GUIDAndOneLevelIndexedSearchTestsLmdb(GUIDAndOneLevelIndexedSearchTests):
def setUp(self):
......@@ -259,7 +259,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
super(GUIDAndOneLevelIndexedSearchTestsLmdb, self).setUp()
@@ -1740,6 +1773,8 @@ class AddModifyTests(LdbBaseTest):
@@ -1681,6 +1714,8 @@ class AddModifyTests(LdbBaseTest):
class AddModifyTestsLmdb(AddModifyTests):
def setUp(self):
......@@ -268,7 +268,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
self.index = MDB_INDEX_OBJ
super(AddModifyTestsLmdb, self).setUp()
@@ -1868,6 +1903,8 @@ class TransIndexedAddModifyTests(IndexedAddModifyTests):
@@ -1801,6 +1836,8 @@ class TransIndexedAddModifyTests(IndexedAddModifyTests):
class GuidIndexedAddModifyTestsLmdb(GUIDIndexedAddModifyTests):
def setUp(self):
......@@ -277,7 +277,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
super(GuidIndexedAddModifyTestsLmdb, self).setUp()
@@ -1878,6 +1915,8 @@ class GuidIndexedAddModifyTestsLmdb(GUIDIndexedAddModifyTests):
@@ -1810,6 +1847,8 @@ class GuidIndexedAddModifyTestsLmdb(GUIDIndexedAddModifyTests):
class GuidTransIndexedAddModifyTestsLmdb(GUIDTransIndexedAddModifyTests):
def setUp(self):
......@@ -286,7 +286,7 @@ index e8826b5af3b..0c4e269239b 100755
self.prefix = MDB_PREFIX
super(GuidTransIndexedAddModifyTestsLmdb, self).setUp()
@@ -2933,6 +2972,8 @@ class LdbResultTests(LdbBaseTest):
@@ -2858,6 +2897,8 @@ class LdbResultTests(LdbBaseTest):
class LdbResultTestsLmdb(LdbResultTests):
def setUp(self):
......@@ -296,10 +296,10 @@ index e8826b5af3b..0c4e269239b 100755
self.index = MDB_INDEX_OBJ
super(LdbResultTestsLmdb, self).setUp()
diff --git a/tests/python/index.py b/tests/python/index.py
index 3652901888e..48dbaccfa56 100755
index 2613a4d..d832993 100755
--- a/tests/python/index.py
+++ b/tests/python/index.py
@@ -1286,6 +1286,8 @@ class MaxIndexKeyLengthTests(LdbBaseTest):
@@ -1285,6 +1285,8 @@ class MaxIndexKeyLengthTests(LdbBaseTest):
class MaxIndexKeyLengthTestsLmdb(MaxIndexKeyLengthTests):
def setUp(self):
......@@ -308,7 +308,7 @@ index 3652901888e..48dbaccfa56 100755
self.prefix = MDB_PREFIX
super(MaxIndexKeyLengthTestsLmdb, self).setUp()
@@ -1297,6 +1299,8 @@ class MaxIndexKeyLengthTestsLmdb(MaxIndexKeyLengthTests):
@@ -1296,6 +1298,8 @@ class MaxIndexKeyLengthTestsLmdb(MaxIndexKeyLengthTests):
class RejectSubDBIndex(LdbBaseTest):
def setUp(self):
......@@ -318,10 +318,10 @@ index 3652901888e..48dbaccfa56 100755
super(RejectSubDBIndex, self).setUp()
self.testdir = tempdir()
diff --git a/wscript b/wscript
index c59d4ead7b9..8f14b09b583 100644
index 5c5ca15..26b7c1a 100644
--- a/wscript
+++ b/wscript
@@ -197,6 +197,7 @@ def configure(conf):
@@ -194,6 +194,7 @@ def configure(conf):
if conf.CHECK_FUNCS_IN('mdb_env_create', 'lmdb', headers='lmdb.h'):
conf.DEFINE('HAVE_LMDB', '1')
......@@ -329,7 +329,7 @@ index c59d4ead7b9..8f14b09b583 100644
conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
@@ -539,21 +540,26 @@ def build(bld):
@@ -528,6 +529,11 @@ def build(bld):
cflags='-DTEST_BE=\"mdb\"',
deps='cmocka ldb',
install=False)
......@@ -341,18 +341,19 @@ index c59d4ead7b9..8f14b09b583 100644
def test(ctx):
'''run ldb testsuite'''
@@ -535,15 +541,15 @@ def test(ctx):
env = samba_utils.LOAD_ENVIRONMENT()
ctx.env = env
- if not env.HAVE_LMDB:
- raise Errors.WafError('make test called, but ldb was built '
- raise Utils.WafError('make test called, but ldb was built '
- '--without-ldb-lmdb')
-
test_prefix = "%s/st" % (Context.g_module.out)
test_prefix = "%s/st" % (Utils.g_module.blddir)
shutil.rmtree(test_prefix, ignore_errors=True)
os.makedirs(test_prefix)
os.environ['TEST_DATA_PREFIX'] = test_prefix
os.environ['LDB_MODULES_PATH'] = Context.g_module.out + "/modules/ldb"
os.environ['LDB_MODULES_PATH'] = Utils.g_module.blddir + "/modules/ldb"
+ if env.HAVE_LMDB:
+ os.environ['HAVE_LMDB'] = '1'
+ else:
......@@ -360,7 +361,7 @@ index c59d4ead7b9..8f14b09b583 100644
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
@@ -578,14 +584,18 @@ def test(ctx):
@@ -567,14 +573,18 @@ def test(ctx):
'ldb_msg_test',
'ldb_tdb_kv_ops_test',
'ldb_tdb_test',
......@@ -383,8 +384,5 @@ index c59d4ead7b9..8f14b09b583 100644
+ test_exes += ['ldb_no_lmdb_test']
+
for test_exe in test_exes:
cmd = os.path.join(Context.g_module.out, test_exe)
cmd = os.path.join(Utils.g_module.blddir, test_exe)
cmocka_ret = cmocka_ret or samba_utils.RUN_COMMAND(cmd)
--
2.20.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment