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 = ""
- 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.
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:
calc = CleanCalculator()
opening_message = "Cleaning targets ..."
closing_message = "done cleaning targets."
+ failure_message = "cleaning terminated because of errors."
except AttributeError:
pass
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()
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))
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")
#
""" % 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)
""" % 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)
""" % 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)