3
# Ubuntu Testing Automation Harness
4
# Copyright 2013 Canonical Ltd.
6
# This program is free software: you can redistribute it and/or modify it
7
# under the terms of the GNU General Public License version 3, as published
8
# by the Free Software Foundation.
10
# This program is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranties of
12
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
# PURPOSE. See the GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License along
16
# with this program. If not, see <http://www.gnu.org/licenses/>.
21
TestSuite = collections.namedtuple('TestSuite', ['name', 'app', 'pkgs'])
24
def _ap_test(name, app=None, pkgs=None):
26
# convert share-app-autopilot to share_app
27
app = name.replace('-', '_').replace('_autopilot', '')
28
return TestSuite(name, app, pkgs)
32
_ap_test('friends-app-autopilot', pkgs=['friends-app-autopilot']),
33
_ap_test('mediaplayer-app-autopilot', pkgs=['mediaplayer-app-autopilot']),
34
_ap_test('gallery-app-autopilot', pkgs=['gallery-app-autopilot']),
35
_ap_test('webbrowser-app-autopilot', pkgs=['webbrowser-app-autopilot']),
36
_ap_test('unity8-autopilot', 'unity8'),
37
_ap_test('notes-app-autopilot'),
38
_ap_test('camera-app-autopilot', pkgs=['camera-app-autopilot']),
39
_ap_test('dialer-app-autopilot', pkgs=['dialer-app-autopilot']),
40
_ap_test('messaging-app-autopilot', pkgs=['messaging-app-autopilot']),
41
_ap_test('address-book-app-autopilot',
42
pkgs=['address-book-app-autopilot']),
43
_ap_test('calendar-app-autopilot', pkgs=['python-dateutil']),
44
_ap_test('music-app-autopilot', pkgs=['python-mock']),
45
_ap_test('dropping-letters-app-autopilot'),
46
_ap_test('ubuntu-calculator-app-autopilot'),
47
_ap_test('ubuntu-clock-app-autopilot'),
48
_ap_test('ubuntu-filemanager-app-autopilot'),
49
_ap_test('ubuntu-rssreader-app-autopilot'),
50
_ap_test('ubuntu-terminal-app-autopilot'),
51
_ap_test('ubuntu-weather-app-autopilot'),
52
_ap_test('ubuntu-ui-toolkit-autopilot', 'ubuntuuitoolkit',
53
['ubuntu-ui-toolkit-autopilot']),
54
_ap_test('ubuntu-system-settings-online-accounts-autopilot',
56
['ubuntu-system-settings-online-accounts-autopilot']),
60
def _handle_packages(args):
62
for suite in TESTSUITES:
63
if not args.app or suite.app in args.app:
65
pkgs.extend(suite.pkgs)
70
def _handle_apps(args):
71
apps = [t.app for t in TESTSUITES]
75
def _handle_tests(args):
76
tests = [t.name for t in TESTSUITES]
77
print(' '.join(tests))
81
parser = argparse.ArgumentParser(
82
description='List information on configured autopilot tests for touch')
83
sub = parser.add_subparsers(title='Commands', metavar='')
85
p = sub.add_parser('packages', help='List packages required for apps')
86
p.set_defaults(func=_handle_packages)
87
p.add_argument('-a', '--app', action='append',
88
help='Autopilot test application. eg share_app')
90
p = sub.add_parser('apps', help='List tests by autopilot application name')
91
p.set_defaults(func=_handle_apps)
93
p = sub.add_parser('tests', help='List tests by CI test name')
94
p.set_defaults(func=_handle_tests)
100
args = _get_parser().parse_args()
101
return args.func(args)
103
if __name__ == '__main__':