summaryrefslogtreecommitdiff
path: root/test/no-global-dependencies.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-02-06 14:55:23 +0000
committerSteven Knight <knight@baldmt.com>2009-02-06 14:55:23 +0000
commita4d9a13b7a85f2c7f55fc409056e3b9628902022 (patch)
tree978573b4ff11f036428c0a08a89085313ad990fa /test/no-global-dependencies.py
parentf706866a1d840a6fc1251ad6c62e137c240967fd (diff)
downloadscons-a4d9a13b7a85f2c7f55fc409056e3b9628902022.tar.gz
Commonize new string-search-in-output methods:
test.must_contain_all_lines() test.must_contain_any_line() test.must_not_contain_any_line() Update tests to use them. Remove "import string" lines where the change made them unnecessary.
Diffstat (limited to 'test/no-global-dependencies.py')
-rw-r--r--test/no-global-dependencies.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/no-global-dependencies.py b/test/no-global-dependencies.py
index 3b6ba977..eb3e6093 100644
--- a/test/no-global-dependencies.py
+++ b/test/no-global-dependencies.py
@@ -35,8 +35,6 @@ done to speed-up a partial rebuild when the developer knows that only
a subset of the targets need to be rebuilt.
"""
-import string
-
import TestSCons
test = TestSCons.TestSCons()
@@ -92,12 +90,12 @@ test.must_not_exist('build/dir1/x.cpp')
# Build everything first.
test.run(arguments = 'duplicate=False view_all_dependencies=True .')
test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
# Double check that targets are not rebuilt.
test.run(arguments = 'duplicate=False view_all_dependencies=True .')
test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
# Clean-up only the object file
test.run(arguments = 'duplicate=False view_all_dependencies=False -c .')
@@ -106,17 +104,17 @@ test.must_exist('build/dir1/x.cpp')
# Rebuild the only object file without seeing all the dependencies.
test.run(arguments = 'duplicate=False view_all_dependencies=False .')
test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
# Double check that targets are not rebuilt without and with all the
# dependencies.
test.run(arguments = 'duplicate=False view_all_dependencies=False .')
test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
test.run(arguments = 'duplicate=False view_all_dependencies=True .')
test.must_exist('build/dir1/x.cpp')
-test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
# Clean-up everything.
test.run(arguments = 'duplicate=False view_all_dependencies=True -c .')
@@ -136,12 +134,12 @@ test.must_not_exist('build/dir1/x.cpp')
# # Build everything first.
# test.run(arguments = 'duplicate=True view_all_dependencies=True .')
# test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+# test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
# # Double check that targets are not rebuilt.
# test.run(arguments = 'duplicate=True view_all_dependencies=True .')
# test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+# test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
# # Clean-up only the object file
# test.run(arguments = 'duplicate=True view_all_dependencies=False -c .')
@@ -150,17 +148,17 @@ test.must_not_exist('build/dir1/x.cpp')
# # Rebuild the only object file without seeing all the dependencies.
# test.run(arguments = 'duplicate=True view_all_dependencies=False .')
# test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") != -1)
+# test.must_not_contain_any_line(test.stdout(), ["`.' is up to date."])
# # Double check that targets are not rebuilt without and with all the
# # dependencies.
# test.run(arguments = 'duplicate=True view_all_dependencies=False .')
# test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+# test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
# test.run(arguments = 'duplicate=True view_all_dependencies=True .')
# test.must_exist('build/dir1/x.cpp')
-# test.fail_test(string.find(test.stdout(), "`.' is up to date.") == -1)
+# test.must_contain_all_lines(test.stdout(), ["`.' is up to date."])
# # Clean-up everything.
# test.run(arguments = 'duplicate=True view_all_dependencies=True -c .')