summaryrefslogtreecommitdiffstats
path: root/test/Value.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-11-21 16:18:50 (GMT)
committerSteven Knight <knight@baldmt.com>2004-11-21 16:18:50 (GMT)
commitefd149d6ff34c81e5a8950604df410bab99a3106 (patch)
tree3b66939e6dc14061317ca19f3371b60c2272c215 /test/Value.py
parent9121165c1f6de68d4c2e8701083de04dfcf2ddc3 (diff)
downloadSCons-efd149d6ff34c81e5a8950604df410bab99a3106.zip
SCons-efd149d6ff34c81e5a8950604df410bab99a3106.tar.gz
SCons-efd149d6ff34c81e5a8950604df410bab99a3106.tar.bz2
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 e3106b8..46f8232 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()