diff options
Diffstat (limited to 'test/option-s.py')
-rw-r--r-- | test/option-s.py | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/test/option-s.py b/test/option-s.py index 9f5e20b..66d92c7 100644 --- a/test/option-s.py +++ b/test/option-s.py @@ -3,6 +3,7 @@ __revision__ = "test/option-s.py __REVISION__ __DATE__ __DEVELOPER__" import TestCmd +import os.path import string import sys @@ -10,22 +11,47 @@ 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') +""") + +test.run(chdir = '.', arguments = '-s f1.out f2.out') + +test.fail_test(test.stdout() != "") +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.run(chdir = '.', arguments = '-s') +os.unlink(test.workpath('f1.out')) +os.unlink(test.workpath('f2.out')) -test.fail_test(test.stderr() != - "Warning: the -s option is not yet implemented\n") +test.run(chdir = '.', arguments = '--silent f1.out f2.out') -test.run(chdir = '.', arguments = '--silent') +test.fail_test(test.stdout() != "") +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 --silent option is not yet implemented\n") +os.unlink(test.workpath('f1.out')) +os.unlink(test.workpath('f2.out')) -test.run(chdir = '.', arguments = '--quiet') +test.run(chdir = '.', arguments = '--quiet f1.out f2.out') -test.fail_test(test.stderr() != - "Warning: the --quiet option is not yet implemented\n") +test.fail_test(test.stdout() != "") +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.pass_test() |