diff options
author | Steven Knight <knight@baldmt.com> | 2004-06-15 12:54:45 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-06-15 12:54:45 (GMT) |
commit | f0bf250b85abbe23faa7eeff0e53beb0613a2c6f (patch) | |
tree | 96cf9c87582bafacbe731704f4f10fbd8e34d331 /test/chained-build.py | |
parent | a0d7c6333aeb9b6f2848ea3c90662f91f7f8ac0e (diff) | |
download | SCons-f0bf250b85abbe23faa7eeff0e53beb0613a2c6f.zip SCons-f0bf250b85abbe23faa7eeff0e53beb0613a2c6f.tar.gz SCons-f0bf250b85abbe23faa7eeff0e53beb0613a2c6f.tar.bz2 |
Add an option to not save the --debug=explain information.
Diffstat (limited to 'test/chained-build.py')
-rw-r--r-- | test/chained-build.py | 81 |
1 files changed, 67 insertions, 14 deletions
diff --git a/test/chained-build.py b/test/chained-build.py index e4463e5..ff14964 100644 --- a/test/chained-build.py +++ b/test/chained-build.py @@ -28,40 +28,93 @@ import TestSCons test = TestSCons.TestSCons() -test.write('SConstruct1', """ +test.subdir('w1', 'w2') + +SConstruct1_contents = """\ def build(env, target, source): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) env=Environment(BUILDERS={'B' : Builder(action=build)}) env.B('foo.mid', 'foo.in') -""") +""" -test.write('SConstruct2', """ +SConstruct2_contents = """\ def build(env, target, source): open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) env=Environment(BUILDERS={'B' : Builder(action=build)}) env.B('foo.out', 'foo.mid') -""") +""" + +# Test with the default of saving explanation info. +test.write(['w1', 'SConstruct1'], SConstruct1_contents) +test.write(['w1', 'SConstruct2'], SConstruct2_contents) +test.write(['w1', 'foo.in'], "foo.in 1") + +test.run(chdir='w1', + arguments="--max-drift=0 -f SConstruct1 foo.mid", + stdout = test.wrap_stdout('build("foo.mid", "foo.in")\n')) +test.run(chdir='w1', + arguments="--max-drift=0 -f SConstruct2 foo.out", + stdout = test.wrap_stdout('build("foo.out", "foo.mid")\n')) + +test.up_to_date(chdir='w1', + options="--max-drift=0 -f SConstruct1", + arguments="foo.mid") +test.up_to_date(chdir='w1', + options="--max-drift=0 -f SConstruct2", + arguments="foo.out") + +test.write(['w1', 'foo.in'], "foo.in 2") + +test.run(chdir='w1', + arguments="--max-drift=0 -f SConstruct1 foo.mid", + stdout = test.wrap_stdout('build("foo.mid", "foo.in")\n')) +test.run(chdir='w1', + arguments="--max-drift=0 -f SConstruct2 foo.out", + stdout = test.wrap_stdout('build("foo.out", "foo.mid")\n')) + +test.up_to_date(chdir='w1', + options="--max-drift=0 -f SConstruct1", + arguments="foo.mid") +test.up_to_date(chdir='w1', + options="--max-drift=0 -f SConstruct2", + arguments="foo.out") -test.write('foo.in', "foo.in") +# Now test when we're not saving explanation info. +preamble = "SetOption('save_explain_info', 0)\n" +test.write(['w2', 'SConstruct1'], preamble + SConstruct1_contents) +test.write(['w2', 'SConstruct2'], preamble + SConstruct2_contents) +test.write(['w2', 'foo.in'], "foo.in 1") -test.run(arguments="--max-drift=0 -f SConstruct1 foo.mid", +test.run(chdir='w2', + arguments="--max-drift=0 -f SConstruct1 foo.mid", stdout = test.wrap_stdout('build("foo.mid", "foo.in")\n')) -test.run(arguments="--max-drift=0 -f SConstruct2 foo.out", +test.run(chdir='w2', + arguments="--max-drift=0 -f SConstruct2 foo.out", stdout = test.wrap_stdout('build("foo.out", "foo.mid")\n')) -test.up_to_date(options="--max-drift=0 -f SConstruct1", arguments="foo.mid") -test.up_to_date(options="--max-drift=0 -f SConstruct2", arguments="foo.out") +test.up_to_date(chdir='w2', + options="--max-drift=0 -f SConstruct1", + arguments="foo.mid") +test.up_to_date(chdir='w2', + options="--max-drift=0 -f SConstruct2", + arguments="foo.out") -test.write('foo.in', "foo.in 2") +test.write(['w2', 'foo.in'], "foo.in 2") -test.run(arguments="--max-drift=0 -f SConstruct1 foo.mid", +test.run(chdir='w2', + arguments="--max-drift=0 -f SConstruct1 foo.mid", stdout = test.wrap_stdout('build("foo.mid", "foo.in")\n')) -test.run(arguments="--max-drift=0 -f SConstruct2 foo.out", +test.run(chdir='w2', + arguments="--max-drift=0 -f SConstruct2 foo.out", stdout = test.wrap_stdout('build("foo.out", "foo.mid")\n')) -test.up_to_date(options="--max-drift=0 -f SConstruct1", arguments="foo.mid") -test.up_to_date(options="--max-drift=0 -f SConstruct2", arguments="foo.out") +test.up_to_date(chdir='w2', + options="--max-drift=0 -f SConstruct1", + arguments="foo.mid") +test.up_to_date(chdir='w2', + options="--max-drift=0 -f SConstruct2", + arguments="foo.out") test.pass_test() |