From 727266233825f379a02fc3a32c1fa46d1ffb1fe8 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 18 Sep 2003 07:43:08 +0000 Subject: Have the closing message say ...terminated --- etc/TestSCons.py | 8 ++++++-- src/CHANGES.txt | 5 +++++ src/engine/SCons/Script/__init__.py | 7 ++++++- test/Exit.py | 4 ++-- test/build-errors.py | 6 +++--- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/etc/TestSCons.py b/etc/TestSCons.py index 59b0647..ede575d 100644 --- a/etc/TestSCons.py +++ b/etc/TestSCons.py @@ -244,16 +244,20 @@ class TestSCons(TestCmd.TestCmd): return None return env.Detect([prog]) - def wrap_stdout(self, build_str = "", read_str = ""): + def wrap_stdout(self, build_str = "", read_str = "", error = 0): """Wraps standard output string(s) in the normal "Reading ... done" and "Building ... done" strings """ + if error: + term = "scons: building terminated because of errors.\n" + else: + term = "scons: done building targets.\n" return "scons: Reading SConscript files ...\n" + \ read_str + \ "scons: done reading SConscript files.\n" + \ "scons: Building targets ...\n" + \ build_str + \ - "scons: done building targets.\n" + term def up_to_date(self, options = None, arguments = None, **kw): s = "" diff --git a/src/CHANGES.txt b/src/CHANGES.txt index f692b74..7fe5cf1 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -82,6 +82,11 @@ RELEASE X.XX - XXX - Split the non-SCons-specific functionality from SConf.py to a new, re-usable Conftest.py module. + From Marko Rauhamaa: + + - Have the closing message say "...terminated because of errors" if + there were any. + From Christoph Wiedemann: - Fix test/SWIG.py to find the Python include directory in all cases. diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index ed9216b..613f775 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -920,6 +920,7 @@ def _main(args, parser): task_class = BuildTask # default action is to build targets opening_message = "Building targets ..." closing_message = "done building targets." + failure_message = "building terminated because of errors." if options.question: task_class = QuestionTask try: @@ -937,6 +938,7 @@ def _main(args, parser): calc = CleanCalculator() opening_message = "Cleaning targets ..." closing_message = "done cleaning targets." + failure_message = "cleaning terminated because of errors." except AttributeError: pass @@ -965,7 +967,10 @@ def _main(args, parser): try: jobs.run() finally: - progress_display("scons: " + closing_message) + if exit_status: + progress_display("scons: " + failure_message) + else: + progress_display("scons: " + closing_message) if not options.noexec: SCons.Sig.write() diff --git a/test/Exit.py b/test/Exit.py index 686cdb3..42ae777 100644 --- a/test/Exit.py +++ b/test/Exit.py @@ -119,7 +119,7 @@ test.write(['subdir', 'foo.in'], "subdir/foo.in\n") test.run(status = 27, stdout = test.wrap_stdout("""\ exit_builder("%s", "%s") -""" % (subdir_foo_out, subdir_foo_in)), +""" % (subdir_foo_out, subdir_foo_in), error=1), stderr = """\ scons: *** [%s] Explicit exit, status 27 """ % (subdir_foo_out)) @@ -150,7 +150,7 @@ env.Cat('foo', 'foo.k') test.write('foo.k', "foo.k\n") test.run(status = 37, - stdout = test.wrap_stdout(""), + stdout = test.wrap_stdout("", error=1), stderr = "scons: *** [foo] Explicit exit, status 37\n") # diff --git a/test/build-errors.py b/test/build-errors.py index 9acbefb..1ea2d7a 100644 --- a/test/build-errors.py +++ b/test/build-errors.py @@ -48,7 +48,7 @@ env.bld(target = 'f1', source = 'f1.in') """ % string.replace(no_such_file, '\\', '\\\\')) test.run(arguments='-f SConstruct1 .', - stdout = test.wrap_stdout("%s f1.in f1\n" % no_such_file), + stdout = test.wrap_stdout("%s f1.in f1\n" % no_such_file, error=1), stderr = None, status = 2) @@ -131,7 +131,7 @@ env.bld(target = 'f2', source = 'f2.in') """ % string.replace(not_executable, '\\', '\\\\')) test.run(arguments='-f SConstruct2 .', - stdout = test.wrap_stdout("%s f2.in f2\n" % not_executable), + stdout = test.wrap_stdout("%s f2.in f2\n" % not_executable, error=1), stderr = None, status = 2) @@ -163,7 +163,7 @@ env.bld(target = 'f3', source = 'f3.in') """ % string.replace(test.workdir, '\\', '\\\\')) test.run(arguments='-f SConstruct3 .', - stdout = test.wrap_stdout("%s f3.in f3\n" % test.workdir), + stdout = test.wrap_stdout("%s f3.in f3\n" % test.workdir, error=1), stderr = None, status = 2) -- cgit v0.12