Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-28 01:47:32 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-28 01:47:32 (GMT)
commitc7749aeaeafa217c838b65a3848548647aa06e89 (patch)
treeef62915b71e5b4578f1ea60970276e23689615d4 /commands
parent224ef97c568300385392e3ca6bf52048dd8a106d (diff)
Generalize a bit how the test command is run
We should be able to use the same logic for other services.
Diffstat (limited to 'commands')
-rw-r--r--commands/common.py12
-rwxr-xr-xcommands/helpers/test11
-rwxr-xr-xcommands/test5
3 files changed, 16 insertions, 12 deletions
diff --git a/commands/common.py b/commands/common.py
index a5dd056..b26e192 100644
--- a/commands/common.py
+++ b/commands/common.py
@@ -13,16 +13,22 @@ from devbot import distro
def setup():
config.load_plugins()
+ relocatable = "SUGAR_BUILDBOT" in os.environ
+ logs_dir = os.path.join(base_dir, "logs")
+ install_dir = os.path.join(base_dir, "install")
+
config.set_devbot_dir(os.path.join(base_dir, "devbot"))
config.set_config_dir(os.path.join(base_dir, "config"))
- config.set_install_dir(os.path.join(base_dir, "install"),
- relocatable="SUGAR_BUILDBOT" in os.environ)
+ config.set_install_dir(install_dir, relocatable=relocatable)
config.set_source_dir(os.path.join(base_dir, "source"))
config.set_build_dir(os.path.join(base_dir, "build"))
config.set_commands_dir(os.path.join(base_dir, "commands"))
- config.set_logs_dir(os.path.join(base_dir, "logs"))
config.set_home_dir(os.path.join(base_dir, "home"))
config.set_prefs_path(os.path.join(base_dir, "prefs"))
+ config.set_logs_dir(logs_dir)
+
+ os.environ["SB_LOGS_DIR"] = logs_dir
+ os.environ["SB_LIBEXEC_DIR"] = config.libexec_dir
version = distro.get_distro_info().system_version
diff --git a/commands/helpers/test b/commands/helpers/test
index a2ea227..4037a0d 100755
--- a/commands/helpers/test
+++ b/commands/helpers/test
@@ -1,9 +1,8 @@
#!/bin/sh
-helpersdir=$SUGAR_BUILD_DIR/install/libexec/sugar-runner
-testsdir=$SUGAR_BUILD_DIR/tests
-logsdir=$SUGAR_BUILD_DIR/logs
-display=`$helpersdir/find-free-display`
+libexecdir=$SB_LIBEXEC_DIR
+logsdir=$SB_LOGS_DIR
+display=`$libexecdir/sugar-runner/find-free-display`
resolution=1024x768x16
xvfb=`which Xvfb`
@@ -17,12 +16,12 @@ export SUGAR_LOGGER_LEVEL=debug
export GTK_MODULES=gail:atk-bridge
export SUGAR_PROFILE=uitests
-xinit $helpersdir/xinitrc -- $xserver &
+xinit $libexecdir/sugar-runner/xinitrc -- $xserver &
xinitpid=$!
sleep 5
-DISPLAY=$display python -u $testsdir/shell.py
+DISPLAY=$display python -u $1
result=$?
kill $xinitpid
diff --git a/commands/test b/commands/test
index ff4f107..a0707e0 100755
--- a/commands/test
+++ b/commands/test
@@ -9,6 +9,5 @@ from devbot import config
common.setup()
-os.environ["SUGAR_BUILD_DIR"] = os.path.join(common.base_dir)
-
-run.run([os.path.join(common.helpers_dir, "test")])
+run.run([os.path.join(common.helpers_dir, "test"),
+ os.path.join(common.base_dir, "tests", "shell.py")])