diff options
author | Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> | 2021-11-09 17:45:16 (GMT) |
---|---|---|
committer | Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> | 2021-11-09 17:45:16 (GMT) |
commit | 699d6b0d571827de973e027d765f64b629f08ed9 (patch) | |
tree | 2c96c3c72a94b2cfea0bcbc41b2715c5bd4b7b2f /test/sconsign | |
parent | 1dc541ef4dafed2cd7af68d23856dd99dd7b5644 (diff) | |
download | SCons-699d6b0d571827de973e027d765f64b629f08ed9.zip SCons-699d6b0d571827de973e027d765f64b629f08ed9.tar.gz SCons-699d6b0d571827de973e027d765f64b629f08ed9.tar.bz2 |
Tests pass in python 3.6 and 3.9 in Linux
Modified failing tests to use the new defaulted .sconsign database based on the hash algorithm
For MD5, default database will be .sconsign.dblite
For other algorithms the default will be .sconsign_<hashname>.dblite.
For all cases where the user changes the hash algorithm used, the database will be .sconsign_<hashname>.dblite (including md5)
For sub-scons directories it remains as .sconsign
Also added unit-tests for Util.py for the new hash default changes.
It's difficult to setup a fips-compliant platform using containers, and instead we mock that.
option--config uses multiple types of hash algorithms so was skipped.
Removed one f-string (python 3.5 doesn't support those)
Corrupt.py is using an explicit .sconsign so that was left as-is, and only the parent default .sconsign was changed for work test 1.
A fetch-database name option was added to the testing framework.
The unlink_sconsignfile was not updated as no usages of it were found.
Diffstat (limited to 'test/sconsign')
-rw-r--r-- | test/sconsign/corrupt.py | 13 | ||||
-rw-r--r-- | test/sconsign/script/Configure.py | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/test/sconsign/corrupt.py b/test/sconsign/corrupt.py index 25b48e2..61da3a2 100644 --- a/test/sconsign/corrupt.py +++ b/test/sconsign/corrupt.py @@ -30,14 +30,19 @@ Test that we get proper warnings when .sconsign* files are corrupt. import TestSCons import TestCmd +import re test = TestSCons.TestSCons(match = TestCmd.match_re) test.subdir('work1', ['work1', 'sub'], 'work2', ['work2', 'sub']) -work1__sconsign_dblite = test.workpath('work1', '.sconsign.dblite') -work2_sub__sconsign = test.workpath('work2', 'sub', '.sconsign') +database_filename = test.get_sconsignname() + ".dblite" + +# for test1 we're using the default database filename +work1__sconsign_dblite = test.workpath('work1', database_filename) +# for test 2 we have an explicit hardcode to .sconsign +work2_sub__sconsign = test.workpath('work2', 'sub', ".sconsign") SConstruct_contents = """\ def build1(target, source, env): @@ -57,9 +62,9 @@ test.write(['work1', 'SConstruct'], SConstruct_contents) test.write(['work1', 'foo.in'], "work1/foo.in\n") stderr = r''' -scons: warning: Ignoring corrupt .sconsign file: \.sconsign\.dblite +scons: warning: Ignoring corrupt .sconsign file: {} .* -''' +'''.format(re.escape(database_filename)) stdout = test.wrap_stdout(r'build1\(\["sub.foo\.out"\], \["foo\.in"\]\)' + '\n') diff --git a/test/sconsign/script/Configure.py b/test/sconsign/script/Configure.py index 7bf1f05..02a2c20 100644 --- a/test/sconsign/script/Configure.py +++ b/test/sconsign/script/Configure.py @@ -90,7 +90,9 @@ conftest_%(sig_re)s_0_%(sig_re)s%(_obj)s: %(CC_file)s: %(sig_re)s \d+ \d+ """ % locals() -test.run_sconsign(arguments = ".sconsign", +# grab .sconsign or .sconsign_<hashname> +database_name=test.get_sconsignname() +test.run_sconsign(arguments = database_name, stdout = expect) test.pass_test() |