コード例 #1
0
def run_suite(name):
    try:
        if not options.cleanup_mode:
            log_info("running suite: %s" % name)
            output_stream.indent()
        try:

            suite_data = file(current_namespace[-1].suites[name]).read()
            calls = parse_suite(suite_data)

            load_configuration(name)
            load_overrides()

            error_list = []
            # skip running suites if cleanup-only mode is set
            if not options.cleanup_mode:
                for script, args, line in calls:
                    errors = run_test(script, args)
                    if len(errors):
                        error_list += [
                            name + "(%d)::%s" % (line, x) for x in errors if x
                        ]
            return error_list
        except IOError, e:
            handle_exception("Unable to read suite %s" % name, e)
            return [name]
    finally:
        do_cleanup_for(name)
        output_stream.outdent()
コード例 #2
0
ファイル: flunc.py プロジェクト: SMFOSS/flunc
def run_suite(name):
    try: 
        if not options.cleanup_mode:
            log_info("running suite: %s" % name)
            output_stream.indent()
        try:
        
            suite_data = file(current_namespace[-1].suites[name]).read()
            calls = parse_suite(suite_data)
        
            load_configuration(name)
            load_overrides() 

            error_list = [] 
            # skip running suites if cleanup-only mode is set 
            if not options.cleanup_mode:
                for script,args,line in calls: 
                    errors = run_test(script,args)
                    if len(errors):                     
                        error_list += [name + "(%d)::%s" % (line,x) for x in errors if x]
            return error_list
        except IOError,e: 
            handle_exception("Unable to read suite %s" % name,e)
            return [name]
    finally: 
        do_cleanup_for(name)
        output_stream.outdent()
コード例 #3
0
                    except (ValueError, TypeError, SyntaxError), e:
                        e.args = ("\"%s%s\": Only positional argument passing is supported in suites." % \
                                      (name, args), ) + e.args[1:]
                        raise e
                    script = make_twill_local_defs(parameters) + script
                    twill.execute_string(script, no_reset=1)
                    return []
                except IOError, e:
                    handle_exception(
                        "Unable to read test '%s'" % (name + TEST), e)
                    return [name]
                except Exception, e:
                    handle_exception("Error running %s" % name, e)
                    return [name]
            finally:
                output_stream.outdent()
    finally:
        current_namespace.pop()


def die(message, parser=None):
    message = str(message)
    log_error(message)
    if parser is not None:
        parser.print_usage()
    sys.exit(0)


def set_use_tidy(value):
    setting = int(bool(value))
    twill.execute_string("config use_tidy %d" % value, no_reset=1)
コード例 #4
0
ファイル: flunc.py プロジェクト: SMFOSS/flunc
                        parameters = make_dict_from_call(args,get_twill_glocals()[0])
                    except (ValueError, TypeError, SyntaxError), e:
                        e.args = ("\"%s%s\": Only positional argument passing is supported in suites." % \
                                      (name, args), ) + e.args[1:]
                        raise e
                    script = make_twill_local_defs(parameters) + script
                    twill.execute_string(script, no_reset=1)
                    return []
                except IOError, e: 
                    handle_exception("Unable to read test '%s'" % (name + TEST), e)
                    return [name]
                except Exception, e: 
                    handle_exception("Error running %s" % name, e)
                    return [name]
            finally:
                output_stream.outdent()
    finally:
        current_namespace.pop()

def die(message, parser=None):
    message = str(message)
    log_error(message)
    if parser is not None:
        parser.print_usage()
    sys.exit(0)

def set_use_tidy(value):
    setting = int(bool(value))
    twill.execute_string("config use_tidy %d" % value, no_reset=1)

def main(argv=None):