summaryrefslogtreecommitdiffstats
path: root/test/Deprecated
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
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')
-rw-r--r--test/Deprecated/debug-dtree.py7
-rw-r--r--test/Deprecated/debug-tree.py16
2 files changed, 6 insertions, 17 deletions
diff --git a/test/Deprecated/debug-dtree.py b/test/Deprecated/debug-dtree.py
index 2aec880..8918052 100644
--- a/test/Deprecated/debug-dtree.py
+++ b/test/Deprecated/debug-dtree.py
@@ -31,7 +31,6 @@ dependencies (sources or Depends()) of a target.
import TestSCons
import sys
-import string
import re
import time
@@ -87,7 +86,7 @@ dtree1 = """
test.run(arguments = "--debug=dtree foo.xxx",
stderr = stderr)
-test.fail_test(string.find(test.stdout(), dtree1) == -1)
+test.must_contain_all_lines(test.stdout(), [dtree1])
dtree2 = """
+-.
@@ -99,7 +98,7 @@ dtree2 = """
"""
test.run(arguments = "--debug=dtree .",
stderr = stderr)
-test.fail_test(string.find(test.stdout(), dtree2) == -1)
+test.must_contain_all_lines(test.stdout(), [dtree2])
# Make sure we print the debug stuff even if there's a build failure.
test.write('bar.h', """
@@ -113,6 +112,6 @@ THIS SHOULD CAUSE A BUILD FAILURE
test.run(arguments = "--debug=dtree foo.xxx",
status = 2,
stderr = None)
-test.fail_test(string.find(test.stdout(), dtree1) == -1)
+test.must_contain_all_lines(test.stdout(), [dtree1])
test.pass_test()
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()