summaryrefslogtreecommitdiff
path: root/test/SideEffect
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/SideEffect
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/SideEffect')
-rw-r--r--test/SideEffect/parallel.py31
1 files changed, 2 insertions, 29 deletions
diff --git a/test/SideEffect/parallel.py b/test/SideEffect/parallel.py
index 7c9bc27c..de4f578b 100644
--- a/test/SideEffect/parallel.py
+++ b/test/SideEffect/parallel.py
@@ -29,8 +29,6 @@ Verify that targets with the same SideEffect are not built in parallel
when the -j option is used.
"""
-import string
-
import TestSCons
_python_ = TestSCons._python_
@@ -80,8 +78,6 @@ test.write('baz.in', 'baz.in\n')
test.run(arguments = "-j 4 .")
-stdout = test.stdout()
-
build_lines = [
'build.py h1.in h1.out',
@@ -89,20 +85,7 @@ build_lines = [
'build.py f3.in f3.out',
]
-missing = []
-for line in build_lines:
- if string.find(stdout, line) == -1:
- missing.append(line)
-
-if missing:
- print "===== standard output is missing the following lines:"
- print string.join(missing, '\n')
- print "===== STDOUT ========================================"
- print stdout
- test.fail_test()
-
-
-log = test.read('log.txt')
+test.must_contain_all_lines(test.stdout(), build_lines)
log_lines = [
'f3.in -> f3.out',
@@ -110,17 +93,7 @@ log_lines = [
'g2.in -> g2.out',
]
-missing = []
-for line in log_lines:
- if string.find(log, line) == -1:
- missing.append(line)
-
-if missing:
- print "===== log file 'log.txt' is missing the following lines:"
- print string.join(missing, '\n')
- print "===== STDOUT ==========================================="
- print log
- test.fail_test()
+test.must_contain_all_lines(test.read('log.txt'), log_lines)
test.pass_test()