diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-04-14 13:17:53 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-04-14 13:17:53 +0200 |
commit | 1f28278abbabe63e5c3061566fa41e643a289734 (patch) | |
tree | f23a995375f5923f65f268d25bdcd9c0da56d41c | |
parent | 466ab6bf71c2fdb98a2b309cff0d8a4753ed74b3 (diff) | |
download | pyexiv2-1f28278abbabe63e5c3061566fa41e643a289734.tar.gz |
The test scons target is now aware of the result of running the test suite.
-rw-r--r-- | SConstruct | 7 | ||||
-rw-r--r-- | test/SConscript | 14 |
2 files changed, 16 insertions, 5 deletions
@@ -27,11 +27,7 @@ def build_doc(): def run_tests(): _fiddle_with_pythonpath() - from test.TestsRunner import run_unit_tests - # FIXME: this is not really well integrated as scons is not informed - # whether the unit tests passed or failed. - # http://www.scons.org/wiki/UnitTests may be of use. - result = run_unit_tests() + SConscript('test/SConscript') if not BUILD_TARGETS: # Default target: lib @@ -44,5 +40,6 @@ else: # module to be in the python path. build_doc() if 'test' in BUILD_TARGETS: + # Note: running the unit tests requires the lib to be built. run_tests() diff --git a/test/SConscript b/test/SConscript new file mode 100644 index 0000000..f1efb4e --- /dev/null +++ b/test/SConscript @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- + +from TestsRunner import run_unit_tests + +def tests_builder(target, source, env): + result = run_unit_tests() + if result.wasSuccessful(): + return None + else: + return result.errors + result.failures + +env = Environment() +env.Command('test', None, tests_builder) + |