From 1d53db3b62d2b4f259b50be4b15a38ce1c152649 Mon Sep 17 00:00:00 2001 From: Simon Poirier Date: Sun, 06 Dec 2009 23:52:49 +0000 Subject: start own Xephyr for running tests. --- 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: -- cgit v0.9.1