Add more information error reporting from tests.
[scons.git] / test / option--.py
1 #!/usr/bin/env python
2
3 __revision__ = "test/option--.py __REVISION__ __DATE__ __DEVELOPER__"
4
5 import TestSCons
6 import os.path
7 import string
8 import sys
9
10 test = TestSCons.TestSCons()
11
12 test.write('build.py', r"""
13 import sys
14 file = open(sys.argv[1], 'w')
15 file.write("build.py: %s\n" % sys.argv[1])
16 file.close()
17 """)
18
19 test.write('SConstruct', """
20 MyBuild = Builder(name = "MyBuild",
21                   action = "python build.py %(target)s")
22 env = Environment(BUILDERS = [MyBuild])
23 env.MyBuild(target = '-f1.out', source = 'f1.in')
24 env.MyBuild(target = '-f2.out', source = 'f2.in')
25 """)
26
27 expect = "python build.py -f1.out\npython build.py -f2.out\n"
28
29 test.run(arguments = '-- -f1.out -f2.out', stdout = expect)
30 test.fail_test(not os.path.exists(test.workpath('-f1.out')))
31 test.fail_test(not os.path.exists(test.workpath('-f2.out')))
32
33 test.pass_test()
34