diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-04-14 11:59:12 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-04-14 11:59:12 +0200 |
commit | 21b0124ed55537a9640dc21fbedfb644cd269ab5 (patch) | |
tree | 334562917686b287ff090814cafca8b822faa00d | |
parent | 6c6d0fda6928aab668bdf1a92e1bebfbcbd6dc52 (diff) | |
download | pyexiv2-21b0124ed55537a9640dc21fbedfb644cd269ab5.tar.gz |
Isolate the PYTHONPATH fiddling in a separate function,
and do it when running the unit tests too.
-rw-r--r-- | SConstruct | 17 |
1 files changed, 12 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,15 +22,15 @@ 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() 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. run_unit_tests() if not BUILD_TARGETS: |