summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2020-01-01 22:21:38 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2020-01-01 22:21:38 (GMT)
commit315cee3763145f01e600d4c09929743ba474891a (patch)
tree2ca21a3ae03e2c8ae5d7d200eabcee80c985d307 /test
parentd82262295ae272ba147d6f056cffa8225cb1629c (diff)
downloadSCons-315cee3763145f01e600d4c09929743ba474891a.zip
SCons-315cee3763145f01e600d4c09929743ba474891a.tar.gz
SCons-315cee3763145f01e600d4c09929743ba474891a.tar.bz2
Fix use-dbm test to work with sconsign files using dbm but where the underlying dbm implementation still writes the file without applying a suffix (like .db). This is due to Travis-ci's py3.8's dbm not applying suffix. Which seems unusual, but still valid
Diffstat (limited to 'test')
-rw-r--r--test/SConsignFile/use-dbm.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/SConsignFile/use-dbm.py b/test/SConsignFile/use-dbm.py
index e02346a..d6c596f 100644
--- a/test/SConsignFile/use-dbm.py
+++ b/test/SConsignFile/use-dbm.py
@@ -27,20 +27,22 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Verify SConsignFile() when used with dbm.
"""
-
+import os.path
+import dbm
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
-
try:
import dbm.ndbm
+
use_db = 'dbm.ndbm'
except ImportError:
try:
import dbm
+
use_db = 'dbm'
except ImportError:
test.skip_test('No dbm.ndbm in this version of Python; skipping test.\n')
@@ -78,20 +80,21 @@ test.run()
# We don't check for explicit .db or other file, because base "dbm"
# can use different file extensions on different implementations.
-test.must_not_exist(test.workpath('.sconsign'))
+test.fail_test(os.path.exists('.sconsign') and 'dbm' not in dbm.whichdb('.sconsign'),
+ message=".sconsign existed an wasn't any type of dbm file")
test.must_not_exist(test.workpath('.sconsign.dblite'))
test.must_not_exist(test.workpath('subdir', '.sconsign'))
test.must_not_exist(test.workpath('subdir', '.sconsign.dblite'))
-
+
test.must_match('f1.out', "f1.in\n")
test.must_match('f2.out', "f2.in\n")
test.must_match(['subdir', 'f3.out'], "subdir/f3.in\n")
test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n")
-test.up_to_date(arguments = '.')
-
+test.up_to_date(arguments='.')
-test.must_not_exist(test.workpath('.sconsign'))
+test.fail_test(os.path.exists('.sconsign') and 'dbm' not in dbm.whichdb('.sconsign'),
+ message=".sconsign existed an wasn't any type of dbm file")
test.must_not_exist(test.workpath('.sconsign.dblite'))
test.must_not_exist(test.workpath('subdir', '.sconsign'))
test.must_not_exist(test.workpath('subdir', '.sconsign.dblite'))