blob: d09f62156a619add37252434709923b9cb2897aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/usr/bin/python
import argparse
import os
import shutil
import sys
import common
from devbot import run
from devbot import test
common.setup()
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.base_dir, "tests", "sugar", "shell.py")
result = run.run_test("sugar-runner", test_path, virtual)
logs_path = os.path.join(profile_path, "logs")
run.collect_logs(logs_path, "test")
if not result:
sys.exit(1)
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)
_run_ui_tests()
|