summaryrefslogtreecommitdiffstats
path: root/test/multiline.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-29 10:52:18 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-29 10:52:18 (GMT)
commit5029b0d71e078e84d0513987860fdea1b72e40cc (patch)
treec5e642ff3d0da4d39d5cf421202a0c1335a29fc7 /test/multiline.py
parent2a69a71894e681e7060e168b99fe7cc608ad7d33 (diff)
downloadSCons-5029b0d71e078e84d0513987860fdea1b72e40cc.zip
SCons-5029b0d71e078e84d0513987860fdea1b72e40cc.tar.gz
SCons-5029b0d71e078e84d0513987860fdea1b72e40cc.tar.bz2
Add support for multi-command Builders and Actions.
Diffstat (limited to 'test/multiline.py')
-rw-r--r--test/multiline.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/multiline.py b/test/multiline.py
new file mode 100644
index 0000000..5c51fac
--- /dev/null
+++ b/test/multiline.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import os.path
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.write('build.py', r"""
+import sys
+contents = open(sys.argv[2], 'r').read()
+file = open(sys.argv[1], 'w')
+file.write(contents)
+file.close()
+""")
+
+test.write('SConstruct', """
+B1 = Builder(name = 'B1', action = ["python build.py .temp %(source)s",
+ "python build.py %(target)s .temp"])
+B2 = Builder(name = 'B2', action = "python build.py .temp %(source)s\\npython build.py %(target)s .temp")
+env = Environment(BUILDERS = [B1, B2])
+env.B1(target = 'foo1.out', source = 'foo1.in')
+env.B2(target = 'foo2.out', source = 'foo2.in')
+env.B1(target = 'foo3.out', source = 'foo3.in')
+""")
+
+test.write('foo1.in', "foo1.in\n")
+
+test.write('foo2.in', "foo2.in\n")
+
+test.write('foo3.in', "foo3.in\n")
+
+test.run(arguments = 'foo1.out foo2.out foo3.out')
+
+test.fail_test(test.read(test.workpath('foo1.out')) != "foo1.in\n")
+test.fail_test(test.read(test.workpath('foo2.out')) != "foo2.in\n")
+test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n")
+
+test.pass_test()
+