Source

SCons / test / DSUFFIXES.py

Diff from to

File test/DSUFFIXES.py

 
 import TestSCons
 
-python = TestSCons.python
+_python_ = TestSCons._python_
 
 test = TestSCons.TestSCons()
 
 Tool('dmd')(env)
 # Now replace those suffixes with our fake-D things.
 env.Replace(DPATH = ['.'],
-            DC = r'%s mydc.py',
+            DC = r'%(_python_)s mydc.py',
             DFLAGS = [],
             DCOM = '$DC $TARGET $SOURCES',
             OBJSUFFIX = '.o')
 env.InstallAs('test1_d', 'test1.d')
 env.InstallAs('test2_d', 'test2.d')
 env.InstallAs('test3_d', 'test3.d')
-""" % (python,))
+""" % locals())
 
 test.write('test1.d', """\
 test1.d 1
 
 test.write('foo.d', "foo.d 1\n")
 
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s mydc.py test1.o test1.d
+expect = test.wrap_stdout("""\
+%(_python_)s mydc.py test1.o test1.d
 Install file: "test1.d" as "test1_d"
 Install file: "test2.d" as "test2_d"
 Install file: "test3.d" as "test3_d"
-""" % (python,)))
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
 
 test.must_match('test1.o', """\
 test1.d 1
 
 test.write('foo.d', "foo.d 2\n")
 
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s mydc.py test1.o test1.d
-""" % (python,)))
+expect = test.wrap_stdout("""\
+%(_python_)s mydc.py test1.o test1.d
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
 
 test.must_match('test1.o', """\
 test1.d 1
 import foo;
 """)
 
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s mydc.py test1.o test1.d
+expect = test.wrap_stdout("""\
+%(_python_)s mydc.py test1.o test1.d
 Install file: "test3.d" as "test3_d"
-""" % (python,)))
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
 
 test.must_match('test1.o', """\
 test1.d 1
 import foo;
 """)
 
-test.run(arguments='.', stdout=test.wrap_stdout("""\
-%s mydc.py test1.o test1.d
+expect = test.wrap_stdout("""\
+%(_python_)s mydc.py test1.o test1.d
 Install file: "test2.d" as "test2_d"
-""" % (python,)))
+""" % locals())
+
+test.run(arguments='.', stdout=expect)
 
 test.must_match('test1.o', """\
 test1.d 1