Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.commands3
-rwxr-xr-xcommands/run-tests39
2 files changed, 28 insertions, 14 deletions
diff --git a/Makefile.commands b/Makefile.commands
index 12ea79d..78805a8 100644
--- a/Makefile.commands
+++ b/Makefile.commands
@@ -32,3 +32,6 @@ build-%:
pull-%:
@$(COMMANDS_DIR)/pull $*
+
+run-tests-%:
+ @$(COMMANDS_DIR)/run-tests $*
diff --git a/commands/run-tests b/commands/run-tests
index a9919df..3f92681 100755
--- a/commands/run-tests
+++ b/commands/run-tests
@@ -1,5 +1,6 @@
#!/usr/bin/python
+import argparse
import os
import shutil
import sys
@@ -11,23 +12,33 @@ from devbot import test
common.setup()
-os.environ["SUGAR_LOGGER_LEVEL"] = "debug"
-os.environ["SUGAR_PROFILE"] = "uitests"
-os.environ["GTK_MODULES"] = "gail:atk-bridge"
+def _run_ui_tests():
+ profile_path = os.path.expanduser("~/.sugar/uitests")
+ shutil.rmtree(profile_path, ignore_errors=True)
+
+ virtual = "SUGAR_BUILDBOT" in os.environ
+ test_path = os.path.join(common.tests_dir, "sugar", "shell.py")
-if not test.test():
- sys.exit(1)
+ result = run.run_test("sugar-runner", test_path, virtual)
-profile_path = os.path.expanduser("~/.sugar/uitests")
-shutil.rmtree(profile_path, ignore_errors=True)
+ logs_path = os.path.join(profile_path, "logs")
+ run.collect_logs(logs_path, "test")
-virtual = "SUGAR_BUILDBOT" in os.environ
-test_path = os.path.join(common.tests_dir, "sugar", "shell.py")
+ if not result:
+ sys.exit(1)
-result = run.run_test("sugar-runner", test_path, virtual)
+parser = argparse.ArgumentParser()
+parser.add_argument("module", nargs="?", help="name of the module to test")
+args = parser.parse_args()
+
+os.environ["SUGAR_LOGGER_LEVEL"] = "debug"
+os.environ["SUGAR_PROFILE"] = "uitests"
+os.environ["GTK_MODULES"] = "gail:atk-bridge"
-logs_path = os.path.join(profile_path, "logs")
-run.collect_logs(logs_path, "test")
+if args.module:
+ test.test_one(args.module)
+else:
+ if not test.test():
+ sys.exit(1)
-if not result:
- sys.exit(1)
+ _run_ui_tests()