diff options
author | Steven Knight <knight@baldmt.com> | 2002-02-21 22:30:24 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-02-21 22:30:24 (GMT) |
commit | 514955d91597edc49a05e5260caaca8db7506ab7 (patch) | |
tree | dd3154bcbb6b4bc9a5b37c42ebf5d481480b528a /test | |
parent | 53bf767e4ba2810d5880d319cc9ac2bf4d4f2590 (diff) | |
download | SCons-514955d91597edc49a05e5260caaca8db7506ab7.zip SCons-514955d91597edc49a05e5260caaca8db7506ab7.tar.gz SCons-514955d91597edc49a05e5260caaca8db7506ab7.tar.bz2 |
Add the -q option.
Diffstat (limited to 'test')
-rw-r--r-- | test/option-q.py | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/test/option-q.py b/test/option-q.py index 8d9fb1b..6e72a26 100644 --- a/test/option-q.py +++ b/test/option-q.py @@ -24,19 +24,53 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -import TestSCons +import os.path import string import sys +import TestSCons + test = TestSCons.TestSCons() -test.write('SConstruct', "") +python = sys.executable + +test.write('build.py', r""" +import sys +contents = open(sys.argv[2], 'rb').read() +file = open(sys.argv[1], 'wb') +file.write(contents) +file.close() +""") + +test.write('SConstruct', """ +B = Builder(name='B', action='%s build.py $TARGET $SOURCES') +env = Environment(BUILDERS = [B]) +env.B(target = 'aaa.out', source = 'aaa.in') +env.B(target = 'bbb.out', source = 'bbb.in') +""" % python) + +test.write('aaa.in', "aaa.in\n") +test.write('bbb.in', "bbb.in\n") + +test.run(arguments = '-q aaa.out', status = 1) + +test.fail_test(os.path.exists(test.workpath('aaa.out'))) + +test.run(arguments = 'aaa.out') + +test.fail_test(test.read('aaa.out') != "aaa.in\n") + +test.run(arguments = '-q aaa.out', status = 0) + +test.run(arguments = '--question bbb.out', status = 1) + +test.fail_test(os.path.exists(test.workpath('bbb.out'))) + +test.run(arguments = 'bbb.out') -test.run(arguments = '-q', - stderr = "Warning: the -q option is not yet implemented\n") +test.fail_test(test.read('bbb.out') != "bbb.in\n") -test.run(arguments = '--question', - stderr = "Warning: the --question option is not yet implemented\n") +test.run(arguments = '--question bbb.out', status = 0) test.pass_test() |