summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-08-17 07:16:58 (GMT)
committerSteven Knight <knight@baldmt.com>2004-08-17 07:16:58 (GMT)
commit483564c8512e0eaccadb2aebe03e7e928225063b (patch)
tree75da8912f958215a28bc564dac4fcf8f5a3f8bf2 /test
parent3a04ee14eb94ec69fb9b1e0a8ca5bc2e209cf38c (diff)
downloadSCons-483564c8512e0eaccadb2aebe03e7e928225063b.zip
SCons-483564c8512e0eaccadb2aebe03e7e928225063b.tar.gz
SCons-483564c8512e0eaccadb2aebe03e7e928225063b.tar.bz2
Test portability fix. Fix handling of >.
Diffstat (limited to 'test')
-rw-r--r--test/Flatten.py10
-rw-r--r--test/redirection.py7
2 files changed, 14 insertions, 3 deletions
diff --git a/test/Flatten.py b/test/Flatten.py
index 7679bdb..1b98f66 100644
--- a/test/Flatten.py
+++ b/test/Flatten.py
@@ -28,6 +28,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
Test that the Flatten() function is available and works.
"""
+import string
+
import TestSCons
test = TestSCons.TestSCons()
@@ -60,13 +62,17 @@ test.write('file1.in', "file1.in\n")
test.write('file2a.in', "file2a.in\n")
test.write('file2b.in', "file2b.in\n")
+def double_backslash(f):
+ p = test.workpath(f)
+ return string.replace(p, '\\', '\\\\')
+
expect = """\
['begin', '%s', 'middle', '%s', 'end']
['%s', 'a', 'b', 'c', '%s']
[1, 2, 3, 4]
[1, 2, 3, 4]
-""" % (test.workpath('file1.out'), test.workpath('file2.out'),
- test.workpath('file1.out'), test.workpath('file2.out'))
+""" % (double_backslash('file1.out'), double_backslash('file2.out'),
+ double_backslash('file1.out'), double_backslash('file2.out'))
test.run(chdir = "work",
arguments = ".",
diff --git a/test/redirection.py b/test/redirection.py
index cc356c6..5aac517 100644
--- a/test/redirection.py
+++ b/test/redirection.py
@@ -49,16 +49,21 @@ env.Command(target='foo2', source='bar2',
action= '%s cat.py < $SOURCES > $TARGET')
env.Command(target='foo3', source='bar3',
action='%s cat.py $SOURCES | %s cat.py > $TARGET')
-""" % (python, python, python, python))
+env.Command(target='foo4', source='bar4',
+ action='%s cat.py <$SOURCES |%s cat.py >$TARGET')
+""" % (python, python, python, python, python, python))
test.write('bar1', 'bar1\r\n')
test.write('bar2', 'bar2\r\n')
test.write('bar3', 'bar3\r\n')
+test.write('bar4', 'bar4\r\n')
test.run(arguments='.')
+
test.fail_test(test.read('foo1') != 'bar1\r\n')
test.fail_test(test.read('foo2') != 'bar2\r\n')
test.fail_test(test.read('foo3') != 'bar3\r\n')
+test.fail_test(test.read('foo4') != 'bar4\r\n')
test.pass_test()