#!/usr/bin/python -u import argparse import os import shutil import sys import common from devbot import run from devbot import test common.setup(log_name="test") def _clear_profile(): profile_path = os.path.expanduser("~/.sugar/uitests") shutil.rmtree(profile_path, ignore_errors=True) def _get_test_path(name): return os.path.join(common.base_dir, "tests", "sugar", name) 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" if args.module: test.test_one(args.module) else: if not test.test(): sys.exit(1) _clear_profile() if run.run_test("sugar-runner", _get_test_path("shell.py")): sys.exit(1) if run.collect_logs(os.path.join(profile_path, "logs")): sys.exit(1)