~veebers/autopilot/move-testing-process-run-fixture

« back to all changes in this revision

Viewing changes to autopilot/run.py

  • Committer: CI bot
  • Author(s): Tarmac
  • Date: 2014-05-09 00:48:06 UTC
  • mfrom: (483.2.19 temp-dev)
  • Revision ID: ps-jenkins@lists.canonical.com-20140509004806-8528si3da584w57j
Initial release of 1.5. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
2
#
3
3
# Autopilot Functional Test Tool
4
 
# Copyright (C) 2012-2013 Canonical
 
4
# Copyright (C) 2012-2014 Canonical
5
5
#
6
6
# This program is free software: you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
53
53
)
54
54
 
55
55
 
56
 
def _parse_arguments(argv=None):
57
 
    """Parse command-line arguments, and return an argparse arguments
58
 
    object.
59
 
    """
 
56
def _get_parser():
 
57
    """Return a parser object for handling command line arguments."""
60
58
    common_arguments = ArgumentParser(add_help=False)
61
59
    common_arguments.add_argument(
62
60
        '--enable-profile', required=False, default=False,
126
124
        default='normal',
127
125
        help="Alter the timeout values Autopilot uses. Selecting 'long' will "
128
126
        "make autopilot use longer timeouts for various polling loops. This "
129
 
        "useful if autopilot is running on very slow hardware"
 
127
        "can be useful if autopilot is running on very slow hardware"
130
128
    )
131
129
    parser_run.add_argument("suite", nargs="+",
132
130
                            help="Specify test suite(s) to run.")
179
177
        help="The application to launch. Can be a full path, or just an "
180
178
        "application name (in which case Autopilot will search for it in "
181
179
        "$PATH).")
 
180
    return parser
 
181
 
 
182
 
 
183
def _parse_arguments(argv=None):
 
184
    """Parse command-line arguments, and return an argparse arguments
 
185
    object.
 
186
    """
 
187
    parser = _get_parser()
182
188
    args = parser.parse_args(args=argv)
183
189
 
184
190
    # TR - 2013-11-27 - a bug in python3.3 means argparse doesn't fail