summaryrefslogtreecommitdiff
path: root/test/Value.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-11-21 16:18:50 +0000
committerSteven Knight <knight@baldmt.com>2004-11-21 16:18:50 +0000
commit8781e4655cea19b34cd062768d9f09b359fe9a09 (patch)
tree3b66939e6dc14061317ca19f3371b60c2272c215 /test/Value.py
parentffc625f8cf332399ba754bf2ebe9e700e5122eac (diff)
downloadscons-8781e4655cea19b34cd062768d9f09b359fe9a09.tar.gz
Fix Value node expansion in command-line strings. (Kevin Quick)
Diffstat (limited to 'test/Value.py')
-rw-r--r--test/Value.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/Value.py b/test/Value.py
index e3106b80..46f82322 100644
--- a/test/Value.py
+++ b/test/Value.py
@@ -40,7 +40,7 @@ for source_signature in ['MD5', 'timestamp']:
print "Testing Value node with source signatures:", source_signature
test.write('SConstruct', """
-SourceSignatures(r'%s')
+SourceSignatures(r'%(source_signature)s')
class Custom:
def __init__(self, value): self.value = value
@@ -55,10 +55,20 @@ def create(target, source, env):
env = Environment()
env['BUILDERS']['B'] = Builder(action = create)
+env['BUILDERS']['S'] = Builder(action = "%(python)s put $SOURCES into $TARGET")
env.B('f1.out', Value(P))
env.B('f2.out', env.Value(L))
env.B('f3.out', Value(C))
-""" % source_signature)
+env.S('f4.out', Value(L))
+""" % {'source_signature':source_signature,
+ 'python':TestSCons.python})
+
+ test.write('put', """
+import os
+import string
+import sys
+open(sys.argv[-1],'wb').write(string.join(sys.argv[1:-2]))
+""")
test.run(arguments='-c')
test.run()
@@ -74,6 +84,7 @@ env.B('f3.out', Value(C))
test.must_match('f1.out', "/usr/local")
test.must_match('f2.out', "10")
test.must_match('f3.out', "C=/usr/local")
+ test.must_match('f4.out', '10')
test.up_to_date(arguments='.')
@@ -89,6 +100,7 @@ env.B('f3.out', Value(C))
test.must_match('f1.out', "/usr")
test.must_match('f2.out', "4")
test.must_match('f3.out', "C=/usr")
+ test.must_match('f4.out', '4')
test.up_to_date('prefix=/usr', '.')
@@ -106,5 +118,6 @@ env.B('f3.out', Value(C))
test.must_match('f1.out', "/var")
test.must_match('f2.out', "4")
test.must_match('f3.out', "C=/var")
+ test.must_match('f4.out', "4")
test.pass_test()