[PyObjC-svn] r2488 - trunk/pyobjc/build-support

[email protected] Thu, 10 Jun 2010 18:25:16 -0500
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Thu Jun 10 18:25:16 2010
New Revision: 2488

Log:
A small tweak that should enable running of the InterfaceBuilderKit
tests


Modified:
   trunk/pyobjc/build-support/run_tests.py

Modified: trunk/pyobjc/build-support/run_tests.py
==============================================================================
--- trunk/pyobjc/build-support/run_tests.py	(original)
+++ trunk/pyobjc/build-support/run_tests.py	Thu Jun 10 18:25:16 2010
@@ -183,6 +183,18 @@
 
     lg = logging.getLogger("run_tests")
 
+    p = subprocess.Popen(["xcode-select", "-print-path" ],
+        cwd=pkgroot, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+    stdout, _ = p.communicate()
+    path = stdout.strip()
+    path = os.path.join(path, "Library", "PrivateFrameworks")
+    ib_env = {
+        'DYLD_FRAMEWORK_PATH': path,
+    }
+    del path
+    
+
     lg.info("Run tests for Python %s with archs %s", version, archs)
 
     subdir = os.path.join(gBaseDir, "virtualenvs", "{0}--{1}".format(version, archs))
@@ -281,6 +293,13 @@
         else:
             pkgroot = os.path.join(gRootDir, pkg)
 
+        if pkg == "pyobjc-framework-InterfaceBuilderKit":
+            env = os.environ.copy()
+            env.update(ib_env)
+            
+        else:
+            env = os.environ
+
         pkgbuild = os.path.join(pkgroot, "build")
         if os.path.exists(pkgbuild):
             lg.debug("Remove build directory for %s", pkg)
@@ -313,7 +332,7 @@
                 p = subprocess.Popen([
                     '/usr/bin/arch', '-' + a,
                     python, "setup.py", "test"],
-                    cwd=pkgroot, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+                    cwd=pkgroot, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
                 stdout, _ = p.communicate()
 
                 with open(os.path.join(resultdir, pkg, "test-stdout-{0}.txt".format(a)), "wb") as fd:
@@ -335,7 +354,8 @@
             lg.debug("Test %s for %s", pkg, os.path.basename(subdir))
             p = subprocess.Popen([
                 python, "setup.py", "test"],
-                cwd=pkgroot, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+                cwd=pkgroot, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+                env=env)
             stdout, _ = p.communicate()
 
             with open(os.path.join(resultdir, pkg, "test-stdout.txt"), "wb") as fd:

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo