Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Poirier <simpoir@gmail.com>2009-12-06 23:52:49 (GMT)
committer Simon Poirier <simpoir@gmail.com>2009-12-06 23:52:49 (GMT)
commit1d53db3b62d2b4f259b50be4b15a38ce1c152649 (patch)
treec7ad08f0c5a2186b80672b1f0586e51665bb2a34
parent7008603df84f0ba868c14151939eae986cd1def0 (diff)
start own Xephyr for running tests.
-rwxr-xr-xsetup.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index fb500c1..106f799 100755
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,7 @@ from os.path import splitext, basename, join as pjoin, walk
import os, sys
import glob
from unittest import TestLoader, TextTestRunner, TestSuite
+from subprocess import Popen
COVERAGE_IGNORE=[
"tutorius/apilib",
@@ -47,6 +48,14 @@ class TestCommand(Command):
'site-packages')
sys.path.insert(1, prefix)
os.environ.setdefault('SUGAR_PREFIX', self.prefix)
+
+ # start another X server so test that manipulates the shell can mess it
+ # up as they wish.
+ # :111 should be high enough, unless we already run sugar-emulator 10
+ # times.
+ x_server = Popen(executable='Xephyr', args=['Xephyr', ':111'])
+ os.environ['DISPLAY'] = ':111'
+
if self.coverage:
import coverage
coverage.erase()
@@ -87,6 +96,8 @@ class TestCommand(Command):
os.chdir(curdir)
coverage.erase()
+ x_server.terminate()
+
def _listsources(self, arg, dirname, fnames):
for name in list(fnames):
if os.path.join(dirname, name) in COVERAGE_IGNORE: