diff options
author | Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> | 2021-11-10 00:03:39 (GMT) |
---|---|---|
committer | Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> | 2021-11-10 00:03:39 (GMT) |
commit | d83d77dd881e683decc1b957f8b0fc3a9d4b8b40 (patch) | |
tree | 2d315d6e4632b79b9d3d54c59394edc9a385596a /test | |
parent | 3a7e06174766bfb40d64e16758543bdf313a134d (diff) | |
download | SCons-d83d77dd881e683decc1b957f8b0fc3a9d4b8b40.zip SCons-d83d77dd881e683decc1b957f8b0fc3a9d4b8b40.tar.gz SCons-d83d77dd881e683decc1b957f8b0fc3a9d4b8b40.tar.bz2 |
Normalized all sconsfiles and sub-sconsfiles to use algorithm if not defaulted to md5.
Dir search now excludes all types of sconsfiles that are now created.
Environment now defaults to the current scons filename instead of .sconsfile
Sconsign now has a function used by a lot of code that gets the default sconsign filename
Any tests referring to .sconsfile have now been changed, including one old legacy test.
Diffstat (limited to 'test')
-rw-r--r-- | test/Removed/SourceSignatures/Old/no-csigs.py | 2 | ||||
-rw-r--r-- | test/SConsignFile/default.py | 15 | ||||
-rw-r--r-- | test/SConsignFile/explicit-dbm-module.py | 15 | ||||
-rw-r--r-- | test/SConsignFile/explicit-file.py | 9 | ||||
-rw-r--r-- | test/SConsignFile/make-directory.py | 3 | ||||
-rw-r--r-- | test/SConsignFile/use-dbhash.py | 22 | ||||
-rw-r--r-- | test/SConsignFile/use-dbm.py | 25 | ||||
-rw-r--r-- | test/SConsignFile/use-dumbdbm.py | 35 | ||||
-rw-r--r-- | test/SConsignFile/use-gdbm.py | 20 | ||||
-rw-r--r-- | test/implicit/changed-node.py | 3 | ||||
-rw-r--r-- | test/sconsign/corrupt.py | 9 | ||||
-rw-r--r-- | test/sconsign/nonwritable.py | 9 | ||||
-rw-r--r-- | test/sconsign/script/SConsignFile.py | 20 | ||||
-rw-r--r-- | test/sconsign/script/Signatures.py | 6 | ||||
-rw-r--r-- | test/sconsign/script/no-SConsignFile.py | 24 |
15 files changed, 122 insertions, 95 deletions
diff --git a/test/Removed/SourceSignatures/Old/no-csigs.py b/test/Removed/SourceSignatures/Old/no-csigs.py index 60c0460..483eeea 100644 --- a/test/Removed/SourceSignatures/Old/no-csigs.py +++ b/test/Removed/SourceSignatures/Old/no-csigs.py @@ -66,7 +66,7 @@ f2.out: \S+ \d+ \d+ \S+ \[build\(target, source, env\)\] """ -test.run_sconsign(arguments = test.workpath('.sconsign'), +test.run_sconsign(arguments = test.workpath(test.get_sconsignname()), stdout = expect) diff --git a/test/SConsignFile/default.py b/test/SConsignFile/default.py index 868f9d7..99ae54e 100644 --- a/test/SConsignFile/default.py +++ b/test/SConsignFile/default.py @@ -59,9 +59,12 @@ test.write(['subdir', 'f4.in'], "subdir/f4.in\n") test.run() -test.must_exist(test.workpath('.sconsign.dblite')) -test.must_not_exist(test.workpath('.sconsign')) -test.must_not_exist(test.workpath('subdir', '.sconsign')) +database_name = test.get_sconsignname() +database_filename = database_name + ".dblite" + +test.must_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath('subdir', database_name)) test.must_match('f1.out', "f1.in\n") test.must_match('f2.out', "f2.in\n") @@ -70,9 +73,9 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments='.') -test.must_exist(test.workpath('.sconsign.dblite')) -test.must_not_exist(test.workpath('.sconsign')) -test.must_not_exist(test.workpath('subdir', '.sconsign')) +test.must_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath('subdir', database_name)) test.pass_test() diff --git a/test/SConsignFile/explicit-dbm-module.py b/test/SConsignFile/explicit-dbm-module.py index c093271..628d8b5 100644 --- a/test/SConsignFile/explicit-dbm-module.py +++ b/test/SConsignFile/explicit-dbm-module.py @@ -61,9 +61,12 @@ test.write(['subdir', 'f4.in'], "subdir/f4.in\n") test.run() -test.must_exist(test.workpath('.sconsign.dblite')) -test.must_not_exist(test.workpath('.sconsign')) -test.must_not_exist(test.workpath('subdir', '.sconsign')) +database_name = test.get_sconsignname() +database_filename = database_name + ".dblite" + +test.must_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath('subdir', database_name)) test.must_match('f1.out', "f1.in\n") test.must_match('f2.out', "f2.in\n") @@ -72,9 +75,9 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments='.') -test.must_exist(test.workpath('.sconsign.dblite')) -test.must_not_exist(test.workpath('.sconsign')) -test.must_not_exist(test.workpath('subdir', '.sconsign')) +test.must_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath('subdir', database_name)) test.pass_test() diff --git a/test/SConsignFile/explicit-file.py b/test/SConsignFile/explicit-file.py index 850b0ef..c601f7f 100644 --- a/test/SConsignFile/explicit-file.py +++ b/test/SConsignFile/explicit-file.py @@ -59,9 +59,10 @@ test.write(['subdir', 'f8.in'], "subdir/f8.in\n") test.run() +database_name = test.get_sconsignname() test.must_exist(test.workpath('my_sconsign.dblite')) -test.must_not_exist(test.workpath('.sconsign')) -test.must_not_exist(test.workpath('subdir', '.sconsign')) +test.must_not_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath('subdir', database_name)) test.must_match('f5.out', "f5.in\n") test.must_match('f6.out', "f6.in\n") @@ -71,8 +72,8 @@ test.must_match(['subdir', 'f8.out'], "subdir/f8.in\n") test.up_to_date(arguments='.') test.must_exist(test.workpath('my_sconsign.dblite')) -test.must_not_exist(test.workpath('.sconsign')) -test.must_not_exist(test.workpath('subdir', '.sconsign')) +test.must_not_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath('subdir', database_name)) test.pass_test() diff --git a/test/SConsignFile/make-directory.py b/test/SConsignFile/make-directory.py index 264ee26..f2a0db1 100644 --- a/test/SConsignFile/make-directory.py +++ b/test/SConsignFile/make-directory.py @@ -57,7 +57,8 @@ test.must_not_exist(['bar', 'foo.txt']) test.must_not_exist('sub') test.must_not_exist(['sub', 'dir']) -test.must_not_exist(['sub', 'dir', '.sconsign.dblite']) +database_name = test.get_sconsignname() +test.must_not_exist(['sub', 'dir', database_name + '.dblite']) test.run(stdout=expect) diff --git a/test/SConsignFile/use-dbhash.py b/test/SConsignFile/use-dbhash.py index 2968cd7..65eb92c 100644 --- a/test/SConsignFile/use-dbhash.py +++ b/test/SConsignFile/use-dbhash.py @@ -48,10 +48,12 @@ with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: sys.exit(0) """) +database_name = test.get_sconsignname() + # test.write('SConstruct', """ import %(use_dbm)s -SConsignFile('.sconsign', %(use_dbm)s) +SConsignFile('%(database_name)s', %(use_dbm)s) DefaultEnvironment(tools=[]) B = Builder(action = r'%(_python_)s build.py $TARGETS $SOURCES') env = Environment(BUILDERS={'B': B}, tools=[]) @@ -68,10 +70,12 @@ test.write(['subdir', 'f4.in'], "subdir/f4.in\n") test.run() -test.must_exist(test.workpath('.sconsign')) -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')) +database_name = test.get_sconsignname() +database_filename = database_name + ".dblite" +test.must_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath('subdir', database_name)) +test.must_not_exist(test.workpath('subdir', database_filename)) test.must_match('f1.out', "f1.in\n") test.must_match('f2.out', "f2.in\n") @@ -80,10 +84,10 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments = '.') -test.must_exist(test.workpath('.sconsign')) -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_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath('subdir', database_name)) +test.must_not_exist(test.workpath('subdir', database_filename)) test.pass_test() diff --git a/test/SConsignFile/use-dbm.py b/test/SConsignFile/use-dbm.py index a1ef1b2..6b6c96b 100644 --- a/test/SConsignFile/use-dbm.py +++ b/test/SConsignFile/use-dbm.py @@ -49,10 +49,11 @@ with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: sys.exit(0) """) +database_name = test.get_sconsignname() # test.write('SConstruct', """ import %(use_dbm)s -SConsignFile('.sconsign', %(use_dbm)s) +SConsignFile('%(database_name)s', %(use_dbm)s) DefaultEnvironment(tools=[]) B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') env = Environment(BUILDERS={'B': B}, tools=[]) @@ -72,13 +73,15 @@ test.run() # We don't check for explicit .db or other file, because base "dbm" # can use different file extensions on different implementations. +database_name = test.get_sconsignname() +database_filename = database_name + '.dblite' test.fail_test( - os.path.exists('.sconsign') and 'dbm' not in dbm.whichdb('.sconsign'), - message=".sconsign existed and wasn't any type of dbm file", + os.path.exists(database_name) and 'dbm' not in dbm.whichdb(database_name), + message="{} existed and wasn't any type of dbm file".format(database_name), ) -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_not_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath('subdir', database_name)) +test.must_not_exist(test.workpath('subdir', database_filename)) test.must_match('f1.out', "f1.in\n") test.must_match('f2.out', "f2.in\n") @@ -87,11 +90,11 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments='.') -test.fail_test(os.path.exists('.sconsign') and 'dbm' not in dbm.whichdb('.sconsign'), - message=".sconsign existed and 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.fail_test(os.path.exists(database_name) and 'dbm' not in dbm.whichdb(database_name), + message="{} existed and wasn't any type of dbm file".format(database_name)) +test.must_not_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath('subdir', database_name)) +test.must_not_exist(test.workpath('subdir', database_filename)) test.pass_test() diff --git a/test/SConsignFile/use-dumbdbm.py b/test/SConsignFile/use-dumbdbm.py index 875f3fc..e7fb091 100644 --- a/test/SConsignFile/use-dumbdbm.py +++ b/test/SConsignFile/use-dumbdbm.py @@ -48,10 +48,11 @@ with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: sys.exit(0) """) +database_name = test.get_sconsignname() # test.write('SConstruct', """ import %(use_dbm)s -SConsignFile('.sconsign', %(use_dbm)s) +SConsignFile('%(database_name)s', %(use_dbm)s) DefaultEnvironment(tools=[]) B = Builder(action=r'%(_python_)s build.py $TARGETS $SOURCES') env = Environment(BUILDERS={'B': B}, tools=[]) @@ -68,14 +69,14 @@ test.write(['subdir', 'f4.in'], "subdir/f4.in\n") test.run() -test.must_exist(test.workpath('.sconsign.dat')) -test.must_exist(test.workpath('.sconsign.dir')) -test.must_not_exist(test.workpath('.sconsign')) -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_not_exist(test.workpath('subdir', '.sconsign.dat')) -test.must_not_exist(test.workpath('subdir', '.sconsign.dir')) +test.must_exist(test.workpath('{}.dat'.format(database_name))) +test.must_exist(test.workpath('{}.dir'.format(database_name))) +test.must_not_exist(test.workpath('{}'.format(database_name))) +test.must_not_exist(test.workpath('{}.dblite'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}.dblite'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}.dat'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}.dir'.format(database_name))) test.must_match('f1.out', "f1.in\n") test.must_match('f2.out', "f2.in\n") @@ -84,14 +85,14 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments='.') -test.must_exist(test.workpath('.sconsign.dat')) -test.must_exist(test.workpath('.sconsign.dir')) -test.must_not_exist(test.workpath('.sconsign')) -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_not_exist(test.workpath('subdir', '.sconsign.dat')) -test.must_not_exist(test.workpath('subdir', '.sconsign.dir')) +test.must_exist(test.workpath('{}.dat'.format(database_name))) +test.must_exist(test.workpath('{}.dir'.format(database_name))) +test.must_not_exist(test.workpath('{}'.format(database_name))) +test.must_not_exist(test.workpath('{}.dblite'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}.dblite'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}.dat'.format(database_name))) +test.must_not_exist(test.workpath('subdir', '{}.dir'.format(database_name))) test.pass_test() diff --git a/test/SConsignFile/use-gdbm.py b/test/SConsignFile/use-gdbm.py index c1f0c4d..11ae052 100644 --- a/test/SConsignFile/use-gdbm.py +++ b/test/SConsignFile/use-gdbm.py @@ -48,10 +48,12 @@ with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: sys.exit(0) """) +database_name = test.get_sconsignname() +database_filename = database_name + '.dblite' # test.write('SConstruct', """ import %(use_dbm)s -SConsignFile('.sconsign', %(use_dbm)s) +SConsignFile('%(database_name)s', %(use_dbm)s) DefaultEnvironment(tools=[]) B = Builder(action='%(_python_)s build.py $TARGETS $SOURCES') env = Environment(BUILDERS={'B': B}, tools=[]) @@ -68,10 +70,10 @@ test.write(['subdir', 'f4.in'], "subdir/f4.in\n") test.run() -test.must_exist(test.workpath('.sconsign')) -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_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath('subdir', database_name)) +test.must_not_exist(test.workpath('subdir', database_filename)) test.must_match('f1.out', "f1.in\n") test.must_match('f2.out', "f2.in\n") @@ -80,10 +82,10 @@ test.must_match(['subdir', 'f4.out'], "subdir/f4.in\n") test.up_to_date(arguments='.') -test.must_exist(test.workpath('.sconsign')) -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_exist(test.workpath(database_name)) +test.must_not_exist(test.workpath(database_filename)) +test.must_not_exist(test.workpath('subdir', database_name)) +test.must_not_exist(test.workpath('subdir', database_filename)) test.pass_test() diff --git a/test/implicit/changed-node.py b/test/implicit/changed-node.py index c8c5a01..d89c14b 100644 --- a/test/implicit/changed-node.py +++ b/test/implicit/changed-node.py @@ -126,8 +126,9 @@ test.pass_test() #def clean(full=0): # for f in ('d','b','a','SConstruct'): # rm(f) +# database_name = test.get_sconsignname() # if full: -# for f in ('.sconsign.dblite', 'build.py'): +# for f in (database_name + '.dblite', 'build.py'): # rm(f) # #clean(1) diff --git a/test/sconsign/corrupt.py b/test/sconsign/corrupt.py index 61da3a2..fa6a0e9 100644 --- a/test/sconsign/corrupt.py +++ b/test/sconsign/corrupt.py @@ -37,12 +37,13 @@ test = TestSCons.TestSCons(match = TestCmd.match_re) test.subdir('work1', ['work1', 'sub'], 'work2', ['work2', 'sub']) -database_filename = test.get_sconsignname() + ".dblite" +database_name = test.get_sconsignname() +database_filename = database_name + ".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") +work2_sub__sconsign = test.workpath('work2', 'sub', database_name) SConstruct_contents = """\ def build1(target, source, env): @@ -87,9 +88,9 @@ test.write(['work2', 'SConstruct'], SConstruct_contents) test.write(['work2', 'foo.in'], "work2/foo.in\n") stderr = r''' -scons: warning: Ignoring corrupt .sconsign file: sub.\.sconsign +scons: warning: Ignoring corrupt .sconsign file: sub.{} .* -''' +'''.format(database_name) stdout = test.wrap_stdout(r'build1\(\["sub.foo\.out"\], \["foo\.in"\]\)' + '\n') diff --git a/test/sconsign/nonwritable.py b/test/sconsign/nonwritable.py index 812a476..e952078 100644 --- a/test/sconsign/nonwritable.py +++ b/test/sconsign/nonwritable.py @@ -44,10 +44,11 @@ test.subdir('work1', ['work2', 'sub2'], ['work2', 'sub3']) -work1__sconsign_dblite = test.workpath('work1', '.sconsign.dblite') -work2_sub1__sconsign = test.workpath('work2', 'sub1', '.sconsign') -work2_sub2__sconsign = test.workpath('work2', 'sub2', '.sconsign') -work2_sub3__sconsign = test.workpath('work2', 'sub3', '.sconsign') +database_name = test.get_sconsignname() +work1__sconsign_dblite = test.workpath('work1', database_name + '.dblite') +work2_sub1__sconsign = test.workpath('work2', 'sub1', database_name) +work2_sub2__sconsign = test.workpath('work2', 'sub2', database_name) +work2_sub3__sconsign = test.workpath('work2', 'sub3', database_name) SConstruct_contents = """\ def build1(target, source, env): diff --git a/test/sconsign/script/SConsignFile.py b/test/sconsign/script/SConsignFile.py index 354bd05..4e29ef0 100644 --- a/test/sconsign/script/SConsignFile.py +++ b/test/sconsign/script/SConsignFile.py @@ -143,7 +143,9 @@ test.run(arguments = '--implicit-cache .') sig_re = r'[0-9a-fA-F]{32,64}' -test.run_sconsign(arguments = ".sconsign", +database_name = test.get_sconsignname() + +test.run_sconsign(arguments = database_name, stdout = r"""=== .: SConstruct: None \d+ \d+ fake_cc\.py: %(sig_re)s \d+ \d+ @@ -174,7 +176,7 @@ inc1.h: %(sig_re)s \d+ \d+ inc2.h: %(sig_re)s \d+ \d+ """ % locals()) -test.run_sconsign(arguments = "--raw .sconsign", +test.run_sconsign(arguments = "--raw " + database_name, stdout = r"""=== .: SConstruct: {'csig': None, 'timestamp': \d+L?, 'size': \d+L?, '_version_id': 2} fake_cc\.py: {'csig': '%(sig_re)s', 'timestamp': \d+L?, 'size': \d+L?, '_version_id': 2} @@ -302,9 +304,9 @@ inc2.h: size: \d+ """ % locals() -test.run_sconsign(arguments = "-v .sconsign", stdout=expect) +test.run_sconsign(arguments = "-v " + database_name, stdout=expect) -test.run_sconsign(arguments = "-c -v .sconsign", +test.run_sconsign(arguments = "-c -v " + database_name, stdout = r"""=== .: SConstruct: csig: None @@ -332,7 +334,7 @@ inc2.h: csig: %(sig_re)s """ % locals()) -test.run_sconsign(arguments = "-s -v .sconsign", +test.run_sconsign(arguments = "-s -v " + database_name, stdout = r"""=== .: SConstruct: size: \d+ @@ -360,7 +362,7 @@ inc2.h: size: \d+ """ % locals()) -test.run_sconsign(arguments = "-t -v .sconsign", +test.run_sconsign(arguments = "-t -v " + database_name, stdout = r"""=== .: SConstruct: timestamp: \d+ @@ -388,7 +390,7 @@ inc2.h: timestamp: \d+ """ % locals()) -test.run_sconsign(arguments = "-e hello.obj .sconsign", +test.run_sconsign(arguments = "-e hello.obj " + database_name, stdout = r"""=== .: === sub1: hello.obj: %(sig_re)s \d+ \d+ @@ -406,7 +408,7 @@ hello.obj: %(sig_re)s \d+ \d+ stderr = r"""sconsign: no entry `hello\.obj' in `\.' """ % locals()) -test.run_sconsign(arguments = "-e hello.obj -e hello.exe -e hello.obj .sconsign", +test.run_sconsign(arguments = "-e hello.obj -e hello.exe -e hello.obj " + database_name, stdout = r"""=== .: === sub1: hello.obj: %(sig_re)s \d+ \d+ @@ -444,7 +446,7 @@ sconsign: no entry `hello\.exe' in `\.' sconsign: no entry `hello\.obj' in `\.' """ % locals()) -#test.run_sconsign(arguments = "-i -v .sconsign", +#test.run_sconsign(arguments = "-i -v " + database_name, # stdout = r"""=== sub1: #hello.exe: # implicit: diff --git a/test/sconsign/script/Signatures.py b/test/sconsign/script/Signatures.py index ecb8dc2..ced5b44 100644 --- a/test/sconsign/script/Signatures.py +++ b/test/sconsign/script/Signatures.py @@ -152,7 +152,9 @@ test.run(arguments = '. --max-drift=1') sig_re = r'[0-9a-fA-F]{32,64}' date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d' -test.run_sconsign(arguments = "-e hello.exe -e hello.obj sub1/.sconsign", +database_name = test.get_sconsignname() + +test.run_sconsign(arguments = "-e hello.exe -e hello.obj sub1/{}".format(database_name), stdout = r"""hello.exe: %(sig_re)s \d+ \d+ %(sub1_hello_obj)s: %(sig_re)s \d+ \d+ fake_link\.py: None \d+ \d+ @@ -163,7 +165,7 @@ hello.obj: %(sig_re)s \d+ \d+ %(sig_re)s \[.*\] """ % locals()) -test.run_sconsign(arguments = "-e hello.exe -e hello.obj -r sub1/.sconsign", +test.run_sconsign(arguments = "-e hello.exe -e hello.obj -r sub1/{}".format(database_name), stdout = r"""hello.exe: %(sig_re)s '%(date_re)s' \d+ %(sub1_hello_obj)s: %(sig_re)s '%(date_re)s' \d+ fake_link\.py: None '%(date_re)s' \d+ diff --git a/test/sconsign/script/no-SConsignFile.py b/test/sconsign/script/no-SConsignFile.py index 1598af4..bdd878b 100644 --- a/test/sconsign/script/no-SConsignFile.py +++ b/test/sconsign/script/no-SConsignFile.py @@ -40,6 +40,8 @@ test = TestSConsign.TestSConsign(match = TestSConsign.match_re) test.subdir('sub1', 'sub2') +database_name = test.get_sconsignname() + # Because this test sets SConsignFile(None), we execute our fake # scripts directly, not by feeding them to the Python executable. # That is, we chmod 0o755 and use a "#!/usr/bin/env python" first @@ -165,9 +167,9 @@ hello.obj: %(sig_re)s \d+ \d+ %(sig_re)s \[.*\] """ % locals() -test.run_sconsign(arguments = "sub1/.sconsign", stdout=expect) +test.run_sconsign(arguments = "sub1/{}".format(database_name), stdout=expect) -test.run_sconsign(arguments = "--raw sub1/.sconsign", +test.run_sconsign(arguments = "--raw sub1/{}".format(database_name), stdout = r"""hello.c: {'csig': '%(sig_re)s', 'timestamp': \d+L?, 'size': \d+L?, '_version_id': 2} hello.exe: {'csig': '%(sig_re)s', 'timestamp': \d+L?, 'size': \d+L?, '_version_id': 2} %(sub1_hello_obj)s: {'csig': '%(sig_re)s', 'timestamp': \d+L?, 'size': \d+L?, '_version_id': 2} @@ -179,7 +181,7 @@ hello.obj: {'csig': '%(sig_re)s', 'timestamp': \d+L?, 'size': \d+L?, '_version_i %(sig_re)s \[.*\] """ % locals()) -test.run_sconsign(arguments = "-v sub1/.sconsign", +test.run_sconsign(arguments = "-v sub1/{}".format(database_name), stdout = r"""hello.c: csig: %(sig_re)s timestamp: \d+ @@ -214,7 +216,7 @@ hello.obj: action: %(sig_re)s \[.*\] """ % locals()) -test.run_sconsign(arguments = "-c -v sub1/.sconsign", +test.run_sconsign(arguments = "-c -v sub1/{}".format(database_name), stdout = r"""hello.c: csig: %(sig_re)s hello.exe: @@ -223,7 +225,7 @@ hello.obj: csig: %(sig_re)s """ % locals()) -test.run_sconsign(arguments = "-s -v sub1/.sconsign", +test.run_sconsign(arguments = "-s -v sub1/{}".format(database_name), stdout = r"""hello.c: size: \d+ hello.exe: @@ -232,7 +234,7 @@ hello.obj: size: \d+ """ % locals()) -test.run_sconsign(arguments = "-t -v sub1/.sconsign", +test.run_sconsign(arguments = "-t -v sub1/{}".format(database_name), stdout = r"""hello.c: timestamp: \d+ hello.exe: @@ -241,14 +243,14 @@ hello.obj: timestamp: \d+ """ % locals()) -test.run_sconsign(arguments = "-e hello.obj sub1/.sconsign", +test.run_sconsign(arguments = "-e hello.obj sub1/{}".format(database_name), stdout = r"""hello.obj: %(sig_re)s \d+ \d+ %(sub1_hello_c)s: %(sig_re)s \d+ \d+ fake_cc\.py: %(sig_re)s \d+ \d+ %(sig_re)s \[.*\] """ % locals()) -test.run_sconsign(arguments = "-e hello.obj -e hello.exe -e hello.obj sub1/.sconsign", +test.run_sconsign(arguments = "-e hello.obj -e hello.exe -e hello.obj sub1/{}".format(database_name), stdout = r"""hello.obj: %(sig_re)s \d+ \d+ %(sub1_hello_c)s: %(sig_re)s \d+ \d+ fake_cc\.py: %(sig_re)s \d+ \d+ @@ -263,7 +265,7 @@ hello.obj: %(sig_re)s \d+ \d+ %(sig_re)s \[.*\] """ % locals()) -test.run_sconsign(arguments = "sub2/.sconsign", +test.run_sconsign(arguments = "sub2/{}".format(database_name), stdout = r"""hello.c: %(sig_re)s \d+ \d+ hello.exe: %(sig_re)s \d+ \d+ %(sub2_hello_obj)s: %(sig_re)s \d+ \d+ @@ -279,7 +281,7 @@ inc1.h: %(sig_re)s \d+ \d+ inc2.h: %(sig_re)s \d+ \d+ """ % locals()) -#test.run_sconsign(arguments = "-i -v sub2/.sconsign", +#test.run_sconsign(arguments = "-i -v sub2/{}".format(database_name), # stdout = r"""hello.c: %(sig_re)s \d+ \d+ #hello.exe: %(sig_re)s \d+ \d+ # implicit: @@ -291,7 +293,7 @@ inc2.h: %(sig_re)s \d+ \d+ # inc2.h: %(sig_re)s \d+ \d+ #""" % locals()) -test.run_sconsign(arguments = "-e hello.obj sub2/.sconsign sub1/.sconsign", +test.run_sconsign(arguments = "-e hello.obj sub2/{} sub1/{}".format(database_name, database_name), stdout = r"""hello.obj: %(sig_re)s \d+ \d+ %(sub2_hello_c)s: %(sig_re)s \d+ \d+ %(sub2_inc1_h)s: %(sig_re)s \d+ \d+ |