summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-04-25 19:47:31 (GMT)
committerSteven Knight <knight@baldmt.com>2004-04-25 19:47:31 (GMT)
commitb208faa0ddd78bdc78d1fb4cdc1953b799b193ee (patch)
tree8d8a4602fe35bf6d30f890c083280157cd8487da /test
parent4573f82503e4ea29b53390a6036ebc2c5d424c86 (diff)
downloadSCons-b208faa0ddd78bdc78d1fb4cdc1953b799b193ee.zip
SCons-b208faa0ddd78bdc78d1fb4cdc1953b799b193ee.tar.gz
SCons-b208faa0ddd78bdc78d1fb4cdc1953b799b193ee.tar.bz2
Have SConsignFile() use a dblite.py module by default, so we can control the behavior. (Ralf W. Grosse-Kunstleve)
Diffstat (limited to 'test')
-rw-r--r--test/SConsignFile.py15
-rw-r--r--test/sconsign-script.py95
2 files changed, 79 insertions, 31 deletions
diff --git a/test/SConsignFile.py b/test/SConsignFile.py
index c919c79..46d0954 100644
--- a/test/SConsignFile.py
+++ b/test/SConsignFile.py
@@ -60,12 +60,7 @@ test.write(['work1', 'subdir', 'f4.in'], "work1/subdir/f4.in\n")
test.run(chdir = 'work1')
-def any_dbm_file(prefix):
- return os.path.exists(prefix) \
- or os.path.exists(prefix + '.dat') \
- or os.path.exists(prefix + '.dir')
-
-test.fail_test(not any_dbm_file(test.workpath('work1', '.sconsign.dbm')))
+test.must_exist(test.workpath('work1', '.sconsign.dblite'))
test.must_not_exist(test.workpath('work1', '.sconsign'))
test.must_not_exist(test.workpath('work1', 'subdir', '.sconsign'))
@@ -76,7 +71,7 @@ test.must_match(['work1', 'subdir', 'f4.out'], "work1/subdir/f4.in\n")
test.up_to_date(chdir = 'work1', arguments = '.')
-test.fail_test(not any_dbm_file(test.workpath('work1', '.sconsign.dbm')))
+test.must_exist(test.workpath('work1', '.sconsign.dblite'))
test.must_not_exist(test.workpath('work1', '.sconsign'))
test.must_not_exist(test.workpath('work1', 'subdir', '.sconsign'))
@@ -99,8 +94,7 @@ test.write(['work2', 'subdir', 'f8.in'], "work2/subdir/f8.in\n")
test.run(chdir = 'work2')
-test.fail_test(not any_dbm_file(test.workpath('work2', 'my_sconsign')))
-test.fail_test(any_dbm_file(test.workpath('work2', '.sconsign.dbm')))
+test.must_exist(test.workpath('work2', 'my_sconsign.dblite'))
test.must_not_exist(test.workpath('work2', '.sconsign'))
test.must_not_exist(test.workpath('work2', 'subdir', '.sconsign'))
@@ -111,8 +105,7 @@ test.must_match(['work2', 'subdir', 'f8.out'], "work2/subdir/f8.in\n")
test.up_to_date(chdir = 'work2', arguments = '.')
-test.fail_test(not any_dbm_file(test.workpath('work2', 'my_sconsign')))
-test.fail_test(any_dbm_file(test.workpath('work2', '.sconsign.dbm')))
+test.must_exist(test.workpath('work2', 'my_sconsign.dblite'))
test.must_not_exist(test.workpath('work2', '.sconsign'))
test.must_not_exist(test.workpath('work2', 'subdir', '.sconsign'))
diff --git a/test/sconsign-script.py b/test/sconsign-script.py
index 24e23a0..3098cd3 100644
--- a/test/sconsign-script.py
+++ b/test/sconsign-script.py
@@ -267,7 +267,11 @@ test.run(chdir = 'work2', arguments = '--implicit-cache .')
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "work2/.sconsign.dbm",
+ arguments = "work2/.sconsign")
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "work2/.sconsign",
stdout = """\
=== sub1:
hello.exe: None \S+ None
@@ -282,7 +286,7 @@ hello.obj: None \S+ None
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-v work2/.sconsign.dbm",
+ arguments = "-v work2/.sconsign",
stdout = """\
=== sub1:
hello.exe:
@@ -310,7 +314,7 @@ hello.obj:
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-b -v work2/.sconsign.dbm",
+ arguments = "-b -v work2/.sconsign",
stdout = """\
=== sub1:
hello.exe:
@@ -326,7 +330,7 @@ hello.obj:
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-c -v work2/.sconsign.dbm",
+ arguments = "-c -v work2/.sconsign",
stdout = """\
=== sub1:
hello.exe:
@@ -342,7 +346,7 @@ hello.obj:
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-e hello.obj work2/.sconsign.dbm",
+ arguments = "-e hello.obj work2/.sconsign",
stdout = """\
=== sub1:
hello.obj: None \S+ None
@@ -355,7 +359,7 @@ hello.obj: None \S+ None
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-e hello.obj -e hello.exe -e hello.obj work2/.sconsign.dbm",
+ arguments = "-e hello.obj -e hello.exe -e hello.obj work2/.sconsign",
stdout = """\
=== sub1:
hello.obj: None \S+ None
@@ -376,7 +380,7 @@ hello.obj: None \S+ None
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-i -v work2/.sconsign.dbm",
+ arguments = "-i -v work2/.sconsign",
stdout = """\
=== sub1:
hello.exe:
@@ -406,41 +410,93 @@ time.sleep(1)
test.run(chdir = 'work2', arguments = '. --max-drift=1')
+expect = """\
+=== sub1:
+hello.exe: None \S+ None
+hello.obj: None \S+ None
+hello.c: \d+ None \d+
+"""
+
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-d sub1 -f dbm work2/my_sconsign")
+ arguments = "-d sub1 -f dblite work2/my_sconsign")
-test.fail_test(not sort_match(test, test.stdout(), """\
+test.fail_test(not sort_match(test, test.stdout(), expect))
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-d sub1 -f dblite work2/my_sconsign.dblite")
+
+test.fail_test(not sort_match(test, test.stdout(), expect))
+
+expect = """\
=== sub1:
hello.exe: None \S+ None
hello.obj: None \S+ None
hello.c: \d+ None \d+
-"""))
+"""
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-r -d sub1 -f dbm work2/my_sconsign")
+ arguments = "-d sub1 -f dblite work2/my_sconsign")
-test.fail_test(not sort_match(test, test.stdout(), """\
+test.fail_test(not sort_match(test, test.stdout(), expect))
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-d sub1 -f dblite work2/my_sconsign.dblite")
+
+test.fail_test(not sort_match(test, test.stdout(), expect))
+
+expect = """\
=== sub1:
hello.exe: None \S+ None
hello.obj: None \S+ None
hello.c: '\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d' None \d+
-"""))
+"""
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-r -d sub1 -f dblite work2/my_sconsign")
+
+test.fail_test(not sort_match(test, test.stdout(), expect))
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-r -d sub1 -f dblite work2/my_sconsign.dblite")
+
+test.fail_test(not sort_match(test, test.stdout(), expect))
##############################################################################
-test.write('bad_sconsign', "bad_sconsign\n")
+test.write('bad1', "bad1\n")
+test.write('bad2.dblite', "bad2.dblite\n")
+test.write('bad3', "bad3\n")
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-f dbm no_sconsign",
+ arguments = "-f dblite no_sconsign",
stderr = "sconsign: \[Errno 2\] No such file or directory: 'no_sconsign'\n")
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-f dbm bad_sconsign",
- stderr = "sconsign: ignoring invalid .sconsign.dbm file `bad_sconsign': db type could not be determined\n")
+ arguments = "-f dblite bad1",
+ stderr = "sconsign: \[Errno 2\] No such file or directory: 'bad1.dblite'\n")
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-f dblite bad1.dblite",
+ stderr = "sconsign: \[Errno 2\] No such file or directory: 'bad1.dblite'\n")
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-f dblite bad2",
+ stderr = "sconsign: ignoring invalid `dblite' file `bad2'\n")
+
+test.run(interpreter = TestSCons.python,
+ program = sconsign,
+ arguments = "-f dblite bad2.dblite",
+ stderr = "sconsign: ignoring invalid `dblite' file `bad2.dblite'\n")
test.run(interpreter = TestSCons.python,
program = sconsign,
@@ -449,8 +505,7 @@ test.run(interpreter = TestSCons.python,
test.run(interpreter = TestSCons.python,
program = sconsign,
- arguments = "-f sconsign bad_sconsign",
- stderr = "sconsign: ignoring invalid .sconsign file `bad_sconsign'\n")
-
+ arguments = "-f sconsign bad3",
+ stderr = "sconsign: ignoring invalid .sconsign file `bad3'\n")
test.pass_test()