示例#1
0
def ProcessCommonOptions(args):
    """Processes and handles all common options."""
    run_tests_helper.SetLogLevel(args.verbose_count)
    constants.SetBuildType(args.build_type)
    if args.build_directory:
        constants.SetBuildDirectory(args.build_directory)
    if args.output_directory:
        constants.SetOutputDirectory(args.output_directory)
    if args.adb_path:
        constants.SetAdbPath(args.adb_path)
    # Some things such as Forwarder require ADB to be in the environment path.
    adb_dir = os.path.dirname(constants.GetAdbPath())
    if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep):
        os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH']
示例#2
0
def ProcessCommonOptions(options, error_func):
    """Processes and handles all common options."""
    run_tests_helper.SetLogLevel(options.verbose_count)
    constants.SetBuildType(options.build_type)
    if options.build_directory:
        constants.SetBuildDirectory(options.build_directory)
    if options.output_directory:
        constants.SetOutputDirectort(options.output_directory)
    if options.adb_path:
        constants.SetAdbPath(options.adb_path)
    # Some things such as Forwarder require ADB to be in the environment path.
    adb_dir = os.path.dirname(constants.GetAdbPath())
    if adb_dir and adb_dir not in os.environ['PATH'].split(os.pathsep):
        os.environ['PATH'] = adb_dir + os.pathsep + os.environ['PATH']
    if options.environment not in constants.VALID_ENVIRONMENTS:
        error_func('--environment must be one of: %s' %
                   ', '.join(constants.VALID_ENVIRONMENTS))