aboutsummaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-04-14 11:59:12 +0200
committerOlivier Tilloy <olivier@tilloy.net>2010-04-14 11:59:12 +0200
commit21b0124ed55537a9640dc21fbedfb644cd269ab5 (patch)
tree334562917686b287ff090814cafca8b822faa00d /SConstruct
parent6c6d0fda6928aab668bdf1a92e1bebfbcbd6dc52 (diff)
downloadpyexiv2-21b0124ed55537a9640dc21fbedfb644cd269ab5.tar.gz
Isolate the PYTHONPATH fiddling in a separate function,
and do it when running the unit tests too.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct17
1 files changed, 12 insertions, 5 deletions
diff --git a/SConstruct b/SConstruct
index ec57e67..f3e9702 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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: