diff options
author | Steven Knight <knight@baldmt.com> | 2002-11-12 04:24:15 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-11-12 04:24:15 (GMT) |
commit | 6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052 (patch) | |
tree | 4a34ebd34c3d15b05b322e099e4825c901e503b0 /test/Repository | |
parent | 8dbe61168174137944a5bc55ea5a9ff389336376 (diff) | |
download | SCons-6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052.zip SCons-6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052.tar.gz SCons-6a9cd3a308b6aa70d0fbaa7bb32e5a3c8fd32052.tar.bz2 |
Arrange for local copies of files in build/ so the Aegis build will continue to work.
Diffstat (limited to 'test/Repository')
-rw-r--r-- | test/Repository/Local.py | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/test/Repository/Local.py b/test/Repository/Local.py index 67f43cf..033fb71 100644 --- a/test/Repository/Local.py +++ b/test/Repository/Local.py @@ -30,10 +30,16 @@ import TestSCons test = TestSCons.TestSCons() -test.subdir('repository', 'work') +test.subdir('repository', ['repository', 'src'], + 'work', ['work', 'src']) +repository_aaa_out = test.workpath('repository', 'aaa.out') +repository_build_bbb_1 = test.workpath('repository', 'build', 'bbb.1') +repository_build_bbb_2 = test.workpath('repository', 'build', 'bbb.2') work_aaa_mid = test.workpath('work', 'aaa.mid') work_aaa_out = test.workpath('work', 'aaa.out') +work_build_bbb_1 = test.workpath('work', 'build', 'bbb.1') +work_build_bbb_2 = test.workpath('work', 'build', 'bbb.2') opts = "-Y " + test.workpath('repository') @@ -50,24 +56,48 @@ env = Environment(BUILDERS={'Build':Build}) env.Build('aaa.mid', 'aaa.in') env.Build('aaa.out', 'aaa.mid') Local('aaa.out') + +Export("env") +BuildDir('build', 'src') +SConscript('build/SConscript') +""") + +test.write(['repository', 'src', 'SConscript'], r""" +def bbb_copy(env, source, target): + target = str(target[0]) + print 'bbb_copy()' + open(target, "wb").write(open('build/bbb.1', "rb").read()) + +Import("env") +env.Build('bbb.1', 'bbb.0') +Local('bbb.1') +env.Command('bbb.2', 'bbb.x', bbb_copy) +env.Depends('bbb.2', 'bbb.1') """) test.write(['repository', 'aaa.in'], "repository/aaa.in\n") +test.write(['repository', 'src', 'bbb.0'], "repository/src/bbb.0\n") +test.write(['repository', 'src', 'bbb.x'], "repository/src/bbb.x\n") # test.run(chdir = 'repository', options = opts, arguments = '.') +test.fail_test(test.read(repository_aaa_out) != "repository/aaa.in\n") +test.fail_test(test.read(repository_build_bbb_2) != "repository/src/bbb.0\n") + +test.up_to_date(chdir = 'repository', options = opts, arguments = '.') + # Make the entire repository non-writable, so we'll detect # if we try to write into it accidentally. test.writable('repository', 0) -test.up_to_date(chdir = 'repository', options = opts, arguments = '.') - # -test.run(chdir = 'work', options = opts, arguments = '.') +test.run(chdir = 'work', options = opts, arguments = 'aaa.out build/bbb.2') test.fail_test(os.path.exists(work_aaa_mid)) test.fail_test(test.read(work_aaa_out) != "repository/aaa.in\n") +test.fail_test(test.read(work_build_bbb_1) != "repository/src/bbb.0\n") +test.fail_test(os.path.exists(work_build_bbb_2)) # test.write(['work', 'aaa.in'], "work/aaa.in\n") |