summaryrefslogtreecommitdiffstats
path: root/test/Scanner.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-04-14 13:09:11 (GMT)
committerSteven Knight <knight@baldmt.com>2004-04-14 13:09:11 (GMT)
commit73f9a42aaa603934e51ffb10bc256e9a3c17cd9b (patch)
tree9fc71cff3cdd7238433923ca761f8d74a8ce23d9 /test/Scanner.py
parente4adb76f832acf1d22f99801a54abb9ea1562182 (diff)
downloadSCons-73f9a42aaa603934e51ffb10bc256e9a3c17cd9b.zip
SCons-73f9a42aaa603934e51ffb10bc256e9a3c17cd9b.tar.gz
SCons-73f9a42aaa603934e51ffb10bc256e9a3c17cd9b.tar.bz2
Fix custom scanner behavior when setting/copying/replacing the SCANNERS construction variable.
Diffstat (limited to 'test/Scanner.py')
-rw-r--r--test/Scanner.py39
1 files changed, 15 insertions, 24 deletions
diff --git a/test/Scanner.py b/test/Scanner.py
index 610eef7..61d9e39 100644
--- a/test/Scanner.py
+++ b/test/Scanner.py
@@ -84,11 +84,12 @@ k2scan = env.Scanner(name = 'k2',
env = Environment()
env.Append(SCANNERS = kscan)
-env.Append(SCANNERS = [k2scan])
env.Command('foo', 'foo.k', r'%s build.py $SOURCES $TARGET')
-env.Command('junk', 'junk.k2', r'%s build.py $SOURCES $TARGET')
+env2 = env.Copy()
+env2.Append(SCANNERS = [k2scan])
+env2.Command('junk', 'junk.k2', r'%s build.py $SOURCES $TARGET')
bar_in = File('bar.in')
env.Command('bar', bar_in, r'%s build.py $SOURCES $TARGET')
@@ -117,18 +118,14 @@ include zzz
""")
test.write('xxx', "xxx 1\n")
-
test.write('yyy', "yyy 1\n")
-
test.write('zzz', "zzz 1\n")
test.run(arguments = '.')
-test.fail_test(test.read('foo') != "foo.k 1 line 1\nxxx 1\nyyy 1\nfoo.k 1 line 4\n")
-
-test.fail_test(test.read('bar') != "yyy 1\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n")
-
-test.fail_test(test.read('junk') != "yyy 1\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n")
+test.must_match('foo', "foo.k 1 line 1\nxxx 1\nyyy 1\nfoo.k 1 line 4\n")
+test.must_match('bar', "yyy 1\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n")
+test.must_match('junk', "yyy 1\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n")
test.up_to_date(arguments = '.')
@@ -136,31 +133,25 @@ test.write('xxx', "xxx 2\n")
test.run(arguments = '.')
-test.fail_test(test.read('foo') != "foo.k 1 line 1\nxxx 2\nyyy 1\nfoo.k 1 line 4\n")
-
-test.fail_test(test.read('bar') != "yyy 1\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n")
-
-test.fail_test(test.read('junk') != "yyy 1\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n")
+test.must_match('foo', "foo.k 1 line 1\nxxx 2\nyyy 1\nfoo.k 1 line 4\n")
+test.must_match('bar', "yyy 1\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n")
+test.must_match('junk', "yyy 1\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n")
test.write('yyy', "yyy 2\n")
test.run(arguments = '.')
-test.fail_test(test.read('foo') != "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4\n")
-
-test.fail_test(test.read('bar') != "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n")
-
-test.fail_test(test.read('junk') != "yyy 2\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n")
+test.must_match('foo', "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4\n")
+test.must_match('bar', "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 1\n")
+test.must_match('junk', "yyy 2\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 1\n")
test.write('zzz', "zzz 2\n")
test.run(arguments = '.')
-test.fail_test(test.read('foo') != "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4\n")
-
-test.fail_test(test.read('bar') != "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 2\n")
-
-test.fail_test(test.read('junk') != "yyy 2\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 2\n")
+test.must_match('foo', "foo.k 1 line 1\nxxx 2\nyyy 2\nfoo.k 1 line 4\n")
+test.must_match('bar', "yyy 2\nbar.in 1 line 2\nbar.in 1 line 3\nzzz 2\n")
+test.must_match('junk', "yyy 2\njunk.k2 1 line 2\njunk.k2 1 line 3\nzzz 2\n")
test.up_to_date(arguments = 'foo')