summaryrefslogtreecommitdiffstats
path: root/test/option-n.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-09-11 13:19:48 (GMT)
committerSteven Knight <knight@baldmt.com>2001-09-11 13:19:48 (GMT)
commitd9fa9439a4424fce36654c68b39e6866cba502c9 (patch)
tree90cf1ba513b52811be3d541862817e96d091eaa3 /test/option-n.py
parent1be774d4845c05bacaecf93eec506ceb038ad8d8 (diff)
downloadSCons-d9fa9439a4424fce36654c68b39e6866cba502c9.zip
SCons-d9fa9439a4424fce36654c68b39e6866cba502c9.tar.gz
SCons-d9fa9439a4424fce36654c68b39e6866cba502c9.tar.bz2
Add -n and -s support.
Diffstat (limited to 'test/option-n.py')
-rw-r--r--test/option-n.py71
1 files changed, 54 insertions, 17 deletions
diff --git a/test/option-n.py b/test/option-n.py
index 12bacd8..245f512 100644
--- a/test/option-n.py
+++ b/test/option-n.py
@@ -3,6 +3,7 @@
__revision__ = "test/option-n.py __REVISION__ __DATE__ __DEVELOPER__"
import TestCmd
+import os.path
import string
import sys
@@ -10,32 +11,68 @@ test = TestCmd.TestCmd(program = 'scons.py',
workdir = '',
interpreter = 'python')
-test.write('SConstruct', "")
+test.write('build.py', r"""
+import sys
+file = open(sys.argv[1], 'w')
+file.write("build.py: %s\n" % sys.argv[1])
+file.close()
+""")
+
+test.write('SConstruct', """
+MyBuild = Builder(name = "MyBuild",
+ action = "python build.py %(target)s")
+env = Environment(BUILDERS = [MyBuild])
+env.MyBuild(target = 'f1.out', source = 'f1.in')
+env.MyBuild(target = 'f2.out', source = 'f2.in')
+""")
+
+args = 'f1.out f2.out'
+expect = "python build.py f1.out\npython build.py f2.out\n"
+
+test.run(chdir = '.', arguments = args)
-test.run(chdir = '.', arguments = '-n')
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(not os.path.exists(test.workpath('f1.out')))
+test.fail_test(not os.path.exists(test.workpath('f2.out')))
-test.fail_test(test.stderr() !=
- "Warning: the -n option is not yet implemented\n")
+os.unlink(test.workpath('f1.out'))
+os.unlink(test.workpath('f2.out'))
-test.run(chdir = '.', arguments = '--no-exec')
+test.run(chdir = '.', arguments = '-n ' + args)
-test.fail_test(test.stderr() !=
- "Warning: the --no-exec option is not yet implemented\n")
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(os.path.exists(test.workpath('f1.out')))
+test.fail_test(os.path.exists(test.workpath('f2.out')))
-test.run(chdir = '.', arguments = '--just-print')
+test.run(chdir = '.', arguments = '--no-exec ' + args)
-test.fail_test(test.stderr() !=
- "Warning: the --just-print option is not yet implemented\n")
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(os.path.exists(test.workpath('f1.out')))
+test.fail_test(os.path.exists(test.workpath('f2.out')))
-test.run(chdir = '.', arguments = '--dry-run')
+test.run(chdir = '.', arguments = '--just-print ' + args)
-test.fail_test(test.stderr() !=
- "Warning: the --dry-run option is not yet implemented\n")
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(os.path.exists(test.workpath('f1.out')))
+test.fail_test(os.path.exists(test.workpath('f2.out')))
-test.run(chdir = '.', arguments = '--recon')
+test.run(chdir = '.', arguments = '--dry-run ' + args)
-test.fail_test(test.stderr() !=
- "Warning: the --recon option is not yet implemented\n")
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(os.path.exists(test.workpath('f1.out')))
+test.fail_test(os.path.exists(test.workpath('f2.out')))
+
+test.run(chdir = '.', arguments = '--recon ' + args)
+
+test.fail_test(test.stdout() != expect)
+test.fail_test(test.stderr() != "")
+test.fail_test(os.path.exists(test.workpath('f1.out')))
+test.fail_test(os.path.exists(test.workpath('f2.out')))
test.pass_test()
-
+