summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/UtilTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2004-09-27 21:24:20 (GMT)
committerSteven Knight <knight@baldmt.com>2004-09-27 21:24:20 (GMT)
commiteb15c920b92e7934a6a55ea86623445e3a25a4cb (patch)
tree10174b4f6c649078aff04722fe7555a9935df39b /src/engine/SCons/UtilTests.py
parent50982d8e28f90646890c6b2cb2e9be7e5726e84a (diff)
downloadSCons-eb15c920b92e7934a6a55ea86623445e3a25a4cb.zip
SCons-eb15c920b92e7934a6a55ea86623445e3a25a4cb.tar.gz
SCons-eb15c920b92e7934a6a55ea86623445e3a25a4cb.tar.bz2
Fix env.subst() stack trace on var containing ListAction.
Diffstat (limited to 'src/engine/SCons/UtilTests.py')
-rw-r--r--src/engine/SCons/UtilTests.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index 054d0b2..5ac6ec0 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -130,6 +130,14 @@ class UtilTestCase(unittest.TestCase):
def is_literal(self):
return 1
+ class TestCallable:
+ def __init__(self, value):
+ self.value = value
+ def __call__(self):
+ pass
+ def __str__(self):
+ return self.value
+
def function_foo(arg):
pass
@@ -194,6 +202,9 @@ class UtilTestCase(unittest.TestCase):
'RECURSE' : 'foo $RECURSE bar',
'RRR' : 'foo $SSS bar',
'SSS' : '$RRR',
+
+ # Test callables that don't match the calling arguments.
+ 'CALLABLE' : TestCallable('callable-1'),
}
env = DummyEnv(loc)
@@ -307,6 +318,9 @@ class UtilTestCase(unittest.TestCase):
# Bug reported by Christoph Wiedemann.
cvt('$xxx/bin'), '/bin',
+
+ # Tests callables that don't match our calling arguments.
+ '$CALLABLE', 'callable-1',
]
kwargs = {'target' : target, 'source' : source}
@@ -474,6 +488,14 @@ class UtilTestCase(unittest.TestCase):
self.attribute.attr1 = 'attr$1-' + os.path.basename(name)
self.attribute.attr2 = 'attr$2-' + os.path.basename(name)
+ class TestCallable:
+ def __init__(self, value):
+ self.value = value
+ def __call__(self):
+ pass
+ def __str__(self):
+ return self.value
+
target = [ MyNode("./foo/bar.exe"),
MyNode("/bar/baz with spaces.obj"),
MyNode("../foo/baz.obj") ]
@@ -529,6 +551,9 @@ class UtilTestCase(unittest.TestCase):
'RECURSE' : 'foo $RECURSE bar',
'RRR' : 'foo $SSS bar',
'SSS' : '$RRR',
+
+ # Test callable objects that don't match our calling arguments.
+ 'CALLABLE' : TestCallable('callable-2'),
}
env = DummyEnv(loc)
@@ -660,6 +685,9 @@ class UtilTestCase(unittest.TestCase):
'<$AAA', [['<', 'a']],
'>$AAA', [['>', 'a']],
'|$AAA', [['|', 'a']],
+
+ # Test callables that don't match our calling arguments.
+ '$CALLABLE', [['callable-2']],
]
kwargs = {'target' : target, 'source' : source}