Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests/runalltests.py
diff options
context:
space:
mode:
authorSascha Silbe <sascha-pgp@silbe.org>2011-05-22 22:33:55 (GMT)
committer Sascha Silbe <sascha-pgp@silbe.org>2011-08-22 14:12:11 (GMT)
commit028e410af82b407a48f6c6b676d026f6c24077f9 (patch)
tree9057f7e23688b0b6995a5ec188ff85d2f7e5757e /tests/runalltests.py
parentb0e6e213cb5179ff3c3cd1bb0f6d08dda4b1d5d3 (diff)
start implementing native API
Diffstat (limited to 'tests/runalltests.py')
-rwxr-xr-xtests/runalltests.py30
1 files changed, 19 insertions, 11 deletions
diff --git a/tests/runalltests.py b/tests/runalltests.py
index 26df032..1ed42c9 100755
--- a/tests/runalltests.py
+++ b/tests/runalltests.py
@@ -32,6 +32,7 @@ logging.basicConfig(level=logging.WARN,
DOCTESTS = [
+ 'native_api_v1.txt',
'sugar_api_v2.txt',
]
DOCTEST_OPTIONS = (doctest.ELLIPSIS | doctest.REPORT_ONLY_FIRST_FAILURE |
@@ -47,6 +48,18 @@ ENVIRONMENT_WHITELIST = [
'GDATASTORE_LOGLEVEL',
]
+
+def write_service_file(service_dir, executable, bus_name):
+ service_path = os.path.join(service_dir, bus_name + '.service')
+ service_file = file(service_path, 'w')
+ service_file.write("""
+ [D-BUS Service]
+ Name = %s
+ Exec = %s
+ """.replace(' ', '') % (bus_name, executable))
+ service_file.close()
+
+
def setup():
"""Prepare for testing and return environment.
@@ -69,19 +82,14 @@ def setup():
python_path = [basedir] + python_path
environment['PYTHONPATH'] = ':'.join(python_path)
environment['PATH'] = os.path.join(basedir, 'bin')+':'+os.environ['PATH']
-
- servicedir = os.path.join(environment['HOME'], 'dbus-1', 'services')
- servicepath = os.path.join(servicedir, 'org.laptop.sugar.DataStore.service')
- os.makedirs(servicedir)
- servicefile = file(servicepath, 'w')
- servicefile.write("""
- [D-BUS Service]
- Name = org.laptop.sugar.DataStore
- Exec = %s/bin/gdatastore-service
- """.replace(' ', '') % (basedir, ))
- servicefile.close()
environment['XDG_DATA_DIRS'] = environment['HOME']
+ service_dir = os.path.join(environment['HOME'], 'dbus-1', 'services')
+ os.makedirs(service_dir)
+ executable = os.path.join(basedir, 'bin', 'gdatastore-service')
+ write_service_file(service_dir, executable, 'org.laptop.sugar.DataStore')
+ write_service_file(service_dir, executable, 'org.silbe.GDataStore')
+
os.setpgid(0, 0)
# prevent suicide in cleanup()
signal.signal(signal.SIGTERM, signal.SIG_IGN)