summaryrefslogtreecommitdiff
path: root/test/Actions
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-02-25 20:50:33 -0800
committerWilliam Deegan <bill@baddogconsulting.com>2017-02-25 20:50:33 -0800
commite3eb3ac2b6ff5d6139896b2d38adf4cde39b3a87 (patch)
tree4acdeef751dc0664e4594a6c9b3077966fb80ba6 /test/Actions
parentc9fb3ff55591d6ed04c051e3f7cd3762135f7961 (diff)
downloadscons-e3eb3ac2b6ff5d6139896b2d38adf4cde39b3a87.tar.gz
remove code to check if python version supports lexical closures (has been supported since python 2.2). Use must_match()'s message param
Diffstat (limited to 'test/Actions')
-rw-r--r--test/Actions/function.py48
1 files changed, 9 insertions, 39 deletions
diff --git a/test/Actions/function.py b/test/Actions/function.py
index 02dbcc7a..941498be 100644
--- a/test/Actions/function.py
+++ b/test/Actions/function.py
@@ -74,7 +74,7 @@ def toto(header='%(header)s', trailer='%(trailer)s'):
f = open(str(target[0]),'wb')
f.write(header)
for d in env['ENVDEPS']:
- f.write(d+'%(separator)s')
+ f.write(bytearray(d+'%(separator)s'))
f.write(trailer+'\\n')
f.write(str(foo())+'\\n')
f.write(r.match('aaaa').group(1)+'\\n')
@@ -88,43 +88,8 @@ def toto(header='%(header)s', trailer='%(trailer)s'):
return writeDeps
'''
-NoClosure = \
-r'''
-def toto(header='%(header)s', trailer='%(trailer)s'):
- xxx = %(closure_cell_value)s
- def writeDeps(target, source, env, b=%(b)s, r=r %(extraarg)s ,
- header=header, trailer=trailer, xxx=xxx):
- """+'"""%(docstring)s"""'+"""
- def foo(b=b, xxx=xxx):
- return %(nestedfuncexp)s
- f = open(str(target[0]),'wb')
- f.write(header)
- for d in env['ENVDEPS']:
- f.write(d+'%(separator)s')
- f.write(trailer+'\\n')
- f.write(str(foo())+'\\n')
- f.write(r.match('aaaa').group(1)+'\\n')
- %(extracode)s
- try:
- f.write(str(xarg)+'\\n')
- except NameError:
- pass
- f.close()
- return writeDeps
-'''
-
-try:
- # Check that lexical closure are supported
- def a():
- x = 0
- def b():
- return x
- return b
- a().func_closure[0].cell_contents
- exec( withClosure % optEnv )
-except (AttributeError, TypeError):
- exec( NoClosure % optEnv )
+exec( withClosure % optEnv )
genHeaderBld = SCons.Builder.Builder(
action = SCons.Action.Action(
@@ -164,13 +129,18 @@ def runtest(arguments, expectedOutFile, expectedRebuild=True, stderr=""):
test.run(arguments=arguments,
stdout=expectedRebuild and rebuildstr or nobuildstr,
stderr="")
- test.must_match('Out.gen.h', expectedOutFile)
+
+ sys.stdout.write('First Build.\n')
+
+ test.must_match('Out.gen.h', expectedOutFile, message="First Build")
# Should not be rebuild when run a second time with the same
# arguments.
+ sys.stdout.write('Rebuild.\n')
+
test.run(arguments = arguments, stdout=nobuildstr, stderr="")
- test.must_match('Out.gen.h', expectedOutFile)
+ test.must_match('Out.gen.h', expectedOutFile, message="Should not rebuild")
# We're making this script chatty to prevent timeouts on really really