diff options
author | Steven Knight <knight@baldmt.com> | 2003-09-05 19:26:05 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-09-05 19:26:05 (GMT) |
commit | bf221d4e593f803116af76ec3bc16514b666c9f1 (patch) | |
tree | d80f1ab39365370ce1f50dba335af34f8cad83e2 /test/AlwaysBuild.py | |
parent | f1d7f1dc87300ea5c905c648c39aeee031100c8c (diff) | |
download | SCons-bf221d4e593f803116af76ec3bc16514b666c9f1.zip SCons-bf221d4e593f803116af76ec3bc16514b666c9f1.tar.gz SCons-bf221d4e593f803116af76ec3bc16514b666c9f1.tar.bz2 |
Support construction variable expansion anywhere in a file or path name.
Diffstat (limited to 'test/AlwaysBuild.py')
-rw-r--r-- | test/AlwaysBuild.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/AlwaysBuild.py b/test/AlwaysBuild.py index f4126c1..832120a 100644 --- a/test/AlwaysBuild.py +++ b/test/AlwaysBuild.py @@ -31,25 +31,36 @@ import TestSCons test = TestSCons.TestSCons() -test.write('SConstruct', """ +test.subdir('sub') + +test.write('SConstruct', """\ def bfunc(target, source, env): import shutil shutil.copyfile('f2.in', str(target[0])) B = Builder(action=bfunc) -env = Environment(BUILDERS = { 'B' : B }) +env = Environment(BUILDERS = { 'B' : B }, SUBDIR='sub') env.B('f1.out', source='f1.in') env.AlwaysBuild('f1.out') -""") + +env.B(r'%s', source='f3.in') +env.AlwaysBuild(r'%s') +""" % (os.path.join('sub', 'f3.out'), + os.path.join('$SUBDIR', 'f3.out') + )) test.write('f1.in', "f1.in\n") test.write('f2.in', "1") +test.write('f3.in', "f3.in\n") test.run(arguments = ".") test.fail_test(test.read('f1.out') != '1') +test.fail_test(test.read(['sub', 'f3.out']) != '1') test.write('f2.in', "2") + test.run(arguments = ".") test.fail_test(test.read('f1.out') != '2') +test.fail_test(test.read(['sub', 'f3.out']) != '2') test.pass_test() |