diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-04-14 13:22:41 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-04-14 13:22:41 +0200 |
commit | 92074ddae3ef32171b33c96a7dd697a55584381a (patch) | |
tree | 6adf88e73678582fd09c5bc1fa787e5f8078a9ee /SConstruct | |
parent | a64fdc513b418bdf15a3acc352157b896db68166 (diff) | |
parent | 1f28278abbabe63e5c3061566fa41e643a289734 (diff) | |
download | pyexiv2-92074ddae3ef32171b33c96a7dd697a55584381a.tar.gz |
Add a "test" scons target to run the unit tests.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -3,6 +3,13 @@ import os import sys +def _fiddle_with_pythonpath(): + # Fiddle with the pythonpath to allow builders to locate pyexiv2 + # (see https://bugs.launchpad.net/pyexiv2/+bug/549398). + curdir = os.path.abspath(os.curdir) + sys.path.insert(0, os.path.join(curdir, 'build')) + sys.path.insert(0, os.path.join(curdir, 'src')) + def build_lib(): try: from site import USER_SITE @@ -15,13 +22,13 @@ def build_lib(): SConscript('src/SConscript', variant_dir='build', duplicate=0) def build_doc(): - # Fiddle with the pythonpath to allow the doc builder to locate pyexiv2 - # (see https://bugs.launchpad.net/pyexiv2/+bug/549398). - curdir = os.path.abspath(os.curdir) - sys.path.insert(0, os.path.join(curdir, 'build')) - sys.path.insert(0, os.path.join(curdir, 'src')) + _fiddle_with_pythonpath() SConscript('doc/SConscript') +def run_tests(): + _fiddle_with_pythonpath() + SConscript('test/SConscript') + if not BUILD_TARGETS: # Default target: lib build_lib() @@ -31,4 +38,7 @@ else: if 'doc' in BUILD_TARGETS: # Note: building the doc requires the lib to be built. build_doc() + if 'test' in BUILD_TARGETS: + # Note: running the unit tests requires the lib to be built. + run_tests() |