+RELEASE 0.07 -
+
+ From Steven Knight:
+
+ - Fix so that -c -n does *not* remove the targets!
+
+
+
RELEASE 0.06 - Thu, 28 Mar 2002 01:24:29 -0600
From Charles Crain:
class CleanTask(SCons.Taskmaster.Task):
"""An SCons clean task."""
- def execute(self):
+ def show(self):
+ if self.targets[0].builder:
+ print "Removed " + self.targets[0].path
+
+ def remove(self):
if self.targets[0].builder:
try:
os.unlink(self.targets[0].path)
except IndexError:
pass
+ execute = remove
+
class QuestionTask(SCons.Taskmaster.Task):
"""An SCons task for the -q (question) option."""
def execute(self):
def opt_n(opt, arg):
SCons.Action.execute_actions = None
+ CleanTask.execute = CleanTask.show
Option(func = opt_n,
short = 'n', long = ['no-exec', 'just-print', 'dry-run', 'recon'],
test.fail_test(os.path.exists(test.workpath('foo2.out')))
test.fail_test(os.path.exists(test.workpath('foo3.out')))
+test.run(arguments = 'foo1.out foo2.out foo3.out')
+
+expect = """Removed foo1.out
+Removed foo2.xxx
+Removed foo2.out
+Removed foo3.out
+"""
+
+test.run(arguments = '-c -n foo1.out foo2.out foo3.out', stdout = expect)
+
+test.run(arguments = '-n -c foo1.out foo2.out foo3.out', stdout = expect)
+
+test.fail_test(test.read(test.workpath('foo1.out')) != "foo1.in\n")
+test.fail_test(test.read(test.workpath('foo2.xxx')) != "foo2.in\n")
+test.fail_test(test.read(test.workpath('foo2.out')) != "foo2.in\n")
+test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n")
+
test.pass_test()
test.fail_test(os.path.exists(test.workpath('f1.out')))
test.fail_test(os.path.exists(test.workpath('f2.out')))
+test.run(arguments = args)
+test.fail_test(not os.path.exists(test.workpath('f1.out')))
+test.fail_test(not os.path.exists(test.workpath('f2.out')))
+
+expect = "Removed f1.out\nRemoved f2.out\n"
+
+test.run(arguments = '-n -c ' + args, stdout = expect)
+
+test.run(arguments = '-c -n ' + args, stdout = expect)
+
+test.fail_test(not os.path.exists(test.workpath('f1.out')))
+test.fail_test(not os.path.exists(test.workpath('f2.out')))
+
test.pass_test()