summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-05-19 03:01:10 (GMT)
committerSteven Knight <knight@baldmt.com>2003-05-19 03:01:10 (GMT)
commita371da732f6b9bdf35639b88b0e6b8370b088261 (patch)
treec485f67398f32e8851d5e7ecad397c709cbaa464
parenta4a6636bb15d7544abb5ee360aff6c7bb9ee21be (diff)
downloadSCons-a371da732f6b9bdf35639b88b0e6b8370b088261.zip
SCons-a371da732f6b9bdf35639b88b0e6b8370b088261.tar.gz
SCons-a371da732f6b9bdf35639b88b0e6b8370b088261.tar.bz2
Change the Building message to say Cleaning when the -c option is used.
-rw-r--r--src/CHANGES.txt3
-rw-r--r--src/engine/SCons/Script/__init__.py8
-rw-r--r--test/option-c.py27
-rw-r--r--test/option-n.py9
4 files changed, 34 insertions, 13 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index df77749..1733520 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -90,6 +90,9 @@ RELEASE 0.14 - XXX
- Optimize out calling hasattr() before accessing attributes.
+ - Say "Cleaning targets" (not "Building...") when the -c option is
+ used.
+
From Damyan Pepper:
- Quote the "Entering directory" message like Make.
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index a1a54e6..c5e469a 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -908,6 +908,8 @@ def _main():
calc = None
task_class = BuildTask # default action is to build targets
+ opening_message = "Building targets ..."
+ closing_message = "done building targets."
if options.question:
task_class = QuestionTask
try:
@@ -923,6 +925,8 @@ def _main():
def write(self):
pass
calc = CleanCalculator()
+ opening_message = "Cleaning targets ..."
+ closing_message = "done cleaning targets."
except AttributeError:
pass
@@ -946,7 +950,7 @@ def _main():
"""Leave the order of dependencies alone."""
return dependencies
- display("scons: Building targets ...")
+ display("scons: " + opening_message)
taskmaster = SCons.Taskmaster.Taskmaster(nodes, task_class, calc, order)
jobs = SCons.Job.Jobs(ssoptions.get('num_jobs'), taskmaster)
@@ -954,7 +958,7 @@ def _main():
try:
jobs.run()
finally:
- display("scons: done building targets.")
+ display("scons: " + closing_message)
SCons.Sig.write()
def main():
diff --git a/test/option-c.py b/test/option-c.py
index 482525d..c149c2a 100644
--- a/test/option-c.py
+++ b/test/option-c.py
@@ -72,8 +72,15 @@ 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")
+def wrap_clean_stdout(string):
+ return "scons: Reading SConscript files ...\n" + \
+ "scons: done reading SConscript files.\n" + \
+ "scons: Cleaning targets ...\n" + \
+ string + \
+ "scons: done cleaning targets.\n"
+
test.run(arguments = '-c foo1.out',
- stdout = test.wrap_stdout("Removed foo1.out\n"))
+ stdout = wrap_clean_stdout("Removed foo1.out\n"))
test.fail_test(os.path.exists(test.workpath('foo1.out')))
test.fail_test(not os.path.exists(test.workpath('foo2.xxx')))
@@ -81,7 +88,7 @@ test.fail_test(not os.path.exists(test.workpath('foo2.out')))
test.fail_test(not os.path.exists(test.workpath('foo3.out')))
test.run(arguments = '--clean foo2.out foo2.xxx',
- stdout = test.wrap_stdout("Removed foo2.xxx\nRemoved foo2.out\n"))
+ stdout = wrap_clean_stdout("Removed foo2.xxx\nRemoved foo2.out\n"))
test.fail_test(os.path.exists(test.workpath('foo1.out')))
test.fail_test(os.path.exists(test.workpath('foo2.xxx')))
@@ -89,7 +96,7 @@ test.fail_test(os.path.exists(test.workpath('foo2.out')))
test.fail_test(not os.path.exists(test.workpath('foo3.out')))
test.run(arguments = '--remove foo3.out',
- stdout = test.wrap_stdout("Removed foo3.out\n"))
+ stdout = wrap_clean_stdout("Removed foo3.out\n"))
test.fail_test(os.path.exists(test.workpath('foo1.out')))
test.fail_test(os.path.exists(test.workpath('foo2.xxx')))
@@ -108,7 +115,7 @@ if hasattr(os, 'symlink'):
test.fail_test(not os.path.islink(test.workpath('symlink2')))
test.run(arguments = '-c foo2.xxx',
- stdout = test.wrap_stdout("Removed foo2.xxx\n"))
+ stdout = wrap_clean_stdout("Removed foo2.xxx\n"))
test.fail_test(test.read(test.workpath('foo1.out')) != "foo1.in\n")
test.fail_test(os.path.exists(test.workpath('foo2.xxx')))
@@ -127,7 +134,7 @@ if hasattr(os, 'symlink'):
test.run(arguments = 'foo1.out foo2.out foo3.out')
-expect = test.wrap_stdout("""Removed foo1.out
+expect = wrap_clean_stdout("""Removed foo1.out
Removed foo2.xxx
Removed foo2.out
Removed foo3.out
@@ -145,7 +152,7 @@ test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n")
test.writable('.', 0)
f = open(test.workpath('foo1.out'))
test.run(arguments = '-c foo1.out',
- stdout = test.wrap_stdout("scons: Could not remove 'foo1.out': Permission denied\n"))
+ stdout = wrap_clean_stdout("scons: Could not remove 'foo1.out': Permission denied\n"))
test.fail_test(not os.path.exists(test.workpath('foo1.out')))
f.close()
test.writable('.', 1)
@@ -172,7 +179,7 @@ test.write(['subd', 'SConscript'], """
Clean('.', 'foox.in')
""")
-expect = test.wrap_stdout("""Removed foo2.xxx
+expect = wrap_clean_stdout("""Removed foo2.xxx
Removed aux1.x
Removed aux2.x
""")
@@ -182,11 +189,11 @@ test.fail_test(os.path.exists(test.workpath('foo2.xxx')))
test.fail_test(test.read(test.workpath('foo2.out')) != "foo2.in\n")
test.fail_test(test.read(test.workpath('foo3.out')) != "foo3.in\n")
-expect = test.wrap_stdout("Removed %s\n" % os.path.join('subd', 'foox.in'))
+expect = wrap_clean_stdout("Removed %s\n" % os.path.join('subd', 'foox.in'))
test.run(arguments = '-c subd', stdout=expect)
test.fail_test(os.path.exists(test.workpath('foox.in')))
-expect = test.wrap_stdout("""Removed foo1.out
+expect = wrap_clean_stdout("""Removed foo1.out
Removed foo2.xxx
Removed foo2.out
Removed foo3.out
@@ -196,7 +203,7 @@ Removed directory subd
""" % (os.path.join('subd','SConscript'), os.path.join('subd', 'foon.in')))
test.run(arguments = '-c -n .', stdout=expect)
-expect = test.wrap_stdout("""Removed foo1.out
+expect = wrap_clean_stdout("""Removed foo1.out
Removed foo2.out
Removed foo3.out
Removed %s
diff --git a/test/option-n.py b/test/option-n.py
index 348c20c..b71648d 100644
--- a/test/option-n.py
+++ b/test/option-n.py
@@ -111,7 +111,14 @@ 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 = test.wrap_stdout("Removed f1.out\nRemoved f2.out\n")
+def wrap_clean_stdout(string):
+ return "scons: Reading SConscript files ...\n" + \
+ "scons: done reading SConscript files.\n" + \
+ "scons: Cleaning targets ...\n" + \
+ string + \
+ "scons: done cleaning targets.\n"
+
+expect = wrap_clean_stdout("Removed f1.out\nRemoved f2.out\n")
test.run(arguments = '-n -c ' + args, stdout = expect)