summaryrefslogtreecommitdiffstats
path: root/test/Deprecated/debug-tree.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-02-06 14:55:23 (GMT)
committerSteven Knight <knight@baldmt.com>2009-02-06 14:55:23 (GMT)
commite112f6b49c9063e6a584ff4f7abf9d7a644eef30 (patch)
tree978573b4ff11f036428c0a08a89085313ad990fa /test/Deprecated/debug-tree.py
parent9405dad6e18db3934eec7b992e12a2016b1466db (diff)
downloadSCons-e112f6b49c9063e6a584ff4f7abf9d7a644eef30.zip
SCons-e112f6b49c9063e6a584ff4f7abf9d7a644eef30.tar.gz
SCons-e112f6b49c9063e6a584ff4f7abf9d7a644eef30.tar.bz2
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/Deprecated/debug-tree.py')
-rw-r--r--test/Deprecated/debug-tree.py16
1 files changed, 3 insertions, 13 deletions
diff --git a/test/Deprecated/debug-tree.py b/test/Deprecated/debug-tree.py
index 0703a16..73b8ec0 100644
--- a/test/Deprecated/debug-tree.py
+++ b/test/Deprecated/debug-tree.py
@@ -31,7 +31,6 @@ complete dependencies of a target.
import TestSCons
import sys
-import string
import re
import time
@@ -104,10 +103,7 @@ tree1 = """
test.run(arguments = "--debug=tree Foo.xxx",
stderr = stderr)
-if string.find(test.stdout(), tree1) == -1:
- sys.stdout.write('Did not find expected tree in the following output:\n')
- sys.stdout.write(test.stdout())
- test.fail_test()
+test.must_contain_all_lines(test.stdout(), tree1)
tree2 = """
+-.
@@ -142,10 +138,7 @@ tree2 = """
test.run(arguments = "--debug=tree .",
stderr = stderr)
-if string.find(test.stdout(), tree2) == -1:
- sys.stdout.write('Did not find expected tree in the following output:\n')
- sys.stdout.write(test.stdout())
- test.fail_test()
+test.must_contain_all_lines(test.stdout(), tree2)
# Make sure we print the debug stuff even if there's a build failure.
test.write('Bar.h', """
@@ -159,9 +152,6 @@ THIS SHOULD CAUSE A BUILD FAILURE
test.run(arguments = "--debug=tree Foo.xxx",
status = 2,
stderr = None)
-if string.find(test.stdout(), tree1) == -1:
- sys.stdout.write('Did not find expected tree in the following output:\n')
- sys.stdout.write(test.stdout())
- test.fail_test()
+test.must_contain_all_lines(test.stdout(), tree1)
test.pass_test()