From b2da8b83cb475c2cdf8af445a063713415d32027 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Thu, 7 Oct 2004 20:10:13 +0000 Subject: [PATCH] Better Command() test coverage. (Kevin Quick) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1118 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- test/Command.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/Command.py b/test/Command.py index f9111c5b..52668860 100644 --- a/test/Command.py +++ b/test/Command.py @@ -65,24 +65,27 @@ def sub(env, target, source): t.close() return 0 -env = Environment() +env = Environment(COPY_THROUGH_TEMP = "cp $SOURCE .tmp\\ncp .tmp $TARGET", + EXPAND = "$COPY_THROUGH_TEMP") env.Command(target = 'f1.out', source = 'f1.in', action = buildIt) env.Command(target = 'f2.out', source = 'f2.in', - action = r"%s build.py temp2 $SOURCES" + '\\n' + r"%s build.py $TARGET temp2") + action = r"%(python)s build.py temp2 $SOURCES" + '\\n' + r"%(python)s build.py $TARGET temp2") env.Command(target = 'f3.out', source = 'f3.in', - action = [ [ r'%s', 'build.py', 'temp3', '$SOURCES' ], - [ r'%s', 'build.py', '$TARGET', 'temp3'] ]) + action = [ [ r'%(python)s', 'build.py', 'temp3', '$SOURCES' ], + [ r'%(python)s', 'build.py', '$TARGET', 'temp3'] ]) Command(target = 'f4.out', source = 'sub', action = sub) env.Command(target = 'f5.out', source = 'f5.in', action = buildIt, XYZZY="XYZZY is set") Command(target = 'f6.out', source = 'f6.in', - action = r"%s build.py f6.out f6.in") + action = r"%(python)s build.py f6.out f6.in") env.Command(target = 'f7.out', source = 'f7.in', - action = r"%s build.py $TARGET $SOURCE") + action = r"%(python)s build.py $TARGET $SOURCE") Command(target = 'f8.out', source = 'f8.in', - action = r"%s build.py $TARGET $SOURCE") -""" % (python, python, python, python, python, python, python)) + action = r"%(python)s build.py $TARGET $SOURCE") +env.Command(target = 'f9.out', source = 'f9.in', + action = r"$EXPAND") +""" % {'python': python}) test.write('f1.in', "f1.in\n") test.write('f2.in', "f2.in\n") @@ -94,6 +97,7 @@ test.write('f5.in', "f5.in\n") test.write('f6.in', "f6.in\n") test.write('f7.in', "f7.in\n") test.write('f8.in', "f8.in\n") +test.write('f9.in', "f9.in\n") test.run(arguments = '.') @@ -105,5 +109,6 @@ test.must_match('f5.out', "XYZZY is set\nf5.in\n") test.must_match('f6.out', "f6.in\n") test.must_match('f7.out', "f7.in\n") test.must_match('f8.out', "f8.in\n") +test.must_match('f9.out', "f9.in\n") test.pass_test() -- 2.26.2