Example #1
0
def compare_results(suite,
                    seed,
                    statements_path,
                    hsql_path,
                    jni_path,
                    output_dir,
                    report_invalid,
                    report_all,
                    extra_stats,
                    comparison_database,
                    modified_sql_path,
                    max_mismatches=0,
                    max_detail_files=-1,
                    within_minutes=0,
                    reproducer=0,
                    ddl_file=None):
    """Just calls SQLCoverageReport.generate_html_reports(...).
    """
    return generate_html_reports(suite,
                                 seed,
                                 statements_path,
                                 hsql_path,
                                 jni_path,
                                 output_dir,
                                 report_invalid,
                                 report_all,
                                 extra_stats,
                                 comparison_database,
                                 modified_sql_path,
                                 max_mismatches,
                                 max_detail_files,
                                 within_minutes,
                                 reproducer,
                                 ddl_file=None,
                                 cntonly=True)
Example #2
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path,
                    output_dir, report_all, extra_stats, comparison_database):
    """Just calls SQLCoverageReport.generate_html_reports(...).
    """
    return generate_html_reports(suite, seed, statements_path, hsql_path,
                                 jni_path, output_dir, report_all, extra_stats,
                                 comparison_database)
def compare_results(
    suite,
    seed,
    statements_path,
    hsql_path,
    jni_path,
    output_dir,
    report_invalid,
    report_all,
    extra_stats,
    comparison_database,
    modified_sql_path,
):
    """Just calls SQLCoverageReport.generate_html_reports(...).
    """
    return generate_html_reports(
        suite,
        seed,
        statements_path,
        hsql_path,
        jni_path,
        output_dir,
        report_invalid,
        report_all,
        extra_stats,
        comparison_database,
        modified_sql_path,
    )
Example #4
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path,
                    output_dir, report_invalid, report_all, extra_stats,
                    comparison_database, modified_sql_path):
    return generate_html_reports(suite, seed, statements_path, hsql_path,
                                 jni_path, output_dir, report_invalid,
                                 report_all, extra_stats, comparison_database,
                                 modified_sql_path)
Example #5
0
def compare_results(suite,
                    seed,
                    statements_path,
                    hsql_path,
                    jni_path,
                    output_dir,
                    report_invalid,
                    report_all,
                    extra_stats,
                    comparison_database,
                    modified_sql_path,
                    max_mismatches=0):
    """Just calls SQLCoverageReport.generate_html_reports(...).
    """
    return generate_html_reports(suite,
                                 seed,
                                 statements_path,
                                 hsql_path,
                                 jni_path,
                                 output_dir,
                                 report_invalid,
                                 report_all,
                                 extra_stats,
                                 comparison_database,
                                 modified_sql_path,
                                 max_mismatches,
                                 cntonly=True)
Example #6
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path,
                    output_dir, report_invalid, report_all, extra_stats,
                    comparison_database, modified_sql_path,
                    max_mismatches=0, within_minutes=0):
    """Just calls SQLCoverageReport.generate_html_reports(...).
    """
    return generate_html_reports(suite, seed, statements_path, hsql_path, jni_path,
                                 output_dir, report_invalid, report_all, extra_stats,
                                 comparison_database, modified_sql_path,
                                 max_mismatches, within_minutes, cntonly=True)
Example #7
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path,
                    output_dir, report_all):
    return generate_html_reports(suite,
                                 seed,
                                 statements_path,
                                 hsql_path,
                                 jni_path,
                                 output_dir,
                                 report_all,
                                 cntonly=True)
def run_config(config, basedir, output_dir, random_seed, report_all, args):
    for key in config.iterkeys():
        if not os.path.isabs(config[key]):
            config[key] = os.path.abspath(os.path.join(basedir, config[key]))
    report_filename = "report.xml"
    report_filename = os.path.abspath(os.path.join(output_dir,
                                                   report_filename))

    global normalize
    if "normalizer" in config:
        normalize = imp.load_source("normalizer",
                                    config["normalizer"]).normalize
    else:
        normalize = lambda x, y: x

    command = " ".join(args[2:])
    command += " schema=" + os.path.basename(config['ddl'])

    generator = SQLGenerator(config["schema"], config["template"])
    statements = []
    counter = 0

    for i in generator.generate():
        statements.append({"id": counter, "SQL": i})
        counter += 1

    if run_once("jni", command, statements) != 0:
        exit(-1)
    if run_once("hsqldb", command, statements) != 0:
        exit(-1)

    report = XMLGenerator({"Statements": statements})
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
    fd = open(report_filename, "w")
    fd.write(report.toXML())
    fd.close()

    success = generate_html_reports({"Statements": statements}, random_seed,
                                    report_all, output_dir)
    return success
Example #9
0
def run_config(config, basedir, output_dir, random_seed, report_all, args):
    for key in config.iterkeys():
        if not os.path.isabs(config[key]):
            config[key] = os.path.abspath(os.path.join(basedir, config[key]))
    report_filename = "report.xml"
    report_filename = os.path.abspath(os.path.join(output_dir, report_filename))

    global normalize
    if "normalizer" in config:
        normalize = imp.load_source("normalizer", config["normalizer"]).normalize
    else:
        normalize = lambda x, y: x

    command = " ".join(args[2:])
    command += " schema=" + os.path.basename(config['ddl'])

    generator = SQLGenerator(config["schema"], config["template"])
    statements = []
    counter = 0

    for i in generator.generate():
        statements.append({"id": counter,
                           "SQL": i})
        counter += 1

    if run_once("jni", command, statements) != 0:
        exit(-1)
    if run_once("hsqldb", command, statements) != 0:
        exit(-1)

    report = XMLGenerator({"Statements": statements})
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
    fd = open(report_filename, "w")
    fd.write(report.toXML())
    fd.close()

    success = generate_html_reports({"Statements": statements},
                                    random_seed, report_all, output_dir)
    return success
Example #10
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path, output_dir, report_all):
    return generate_html_reports(suite, seed, statements_path, hsql_path, jni_path,
            output_dir, report_all)
Example #11
0
def run_config(config, basedir, output_dir, random_seed, report_all, args):
    for key in config.iterkeys():
        if not os.path.isabs(config[key]):
            config[key] = os.path.abspath(os.path.join(basedir, config[key]))
    report_filename = "report.xml"
    report_filename = os.path.abspath(os.path.join(output_dir, report_filename))
    template = config["template"]

    global normalize
    if "normalizer" in config:
        normalize = imp.load_source("normalizer", config["normalizer"]).normalize
    else:
        normalize = lambda x, y: x

    command = " ".join(args[2:])
    command += " schema=" + os.path.basename(config["ddl"])

    random_state = random.getstate()
    if "template-jni" in config:
        template = config["template-jni"]
    generator = SQLGenerator(config["schema"], template, True)
    statements = []
    counter = 0

    for i in generator.generate():
        statements.append({"id": counter, "SQL": i})
        counter += 1

    if run_once("jni", command, statements) != 0:
        print >> sys.stderr, "Test with the JNI backend had errors."
        exit(1)

    random.seed(random_seed)
    random.setstate(random_state)
    # To get around the timestamp issue. Volt and HSQLDB use different units
    # for timestamp (microsec vs. millisec), so we have to use different
    # template file for regression test, since all the statements are not
    # generated in this case.
    if "template-hsqldb" in config:
        template = config["template-hsqldb"]
    generator = SQLGenerator(config["schema"], template, False)
    counter = 0

    for i in generator.generate():
        statements[counter]["SQL"] = i
        counter += 1

    if run_once("hsqldb", command, statements) != 0:
        print >> sys.stderr, "Test with the HSQLDB backend had errors."
        exit(1)

    report_dict = {"Seed": random_seed, "Statements": statements}
    report = XMLGenerator(report_dict)
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
    fd = open(report_filename, "w")
    fd.write(report.toXML())
    fd.close()

    success = generate_html_reports(report_dict, output_dir, report_all)
    return success
Example #12
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path,
                    output_dir, report_all, extra_stats, comparison_database):
    return generate_html_reports(suite, seed, statements_path, hsql_path, jni_path,
                                 output_dir, report_all, extra_stats, comparison_database)
Example #13
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path, output_dir, report_all, extra_stats):
    """Just calls SQLCoverageReport.generate_html_reports(...).
    """
    return generate_html_reports(
        suite, seed, statements_path, hsql_path, jni_path, output_dir, report_all, extra_stats, True
    )
Example #14
0
def compare_results(suite, seed, statements_path, hsql_path, jni_path,
                    output_dir, report_all, extra_stats):
    return generate_html_reports(suite, seed, statements_path, hsql_path,
                                 jni_path, output_dir, report_all, extra_stats)
Example #15
0
def run_config(config, basedir, output_dir, random_seed, report_all, args):
    for key in config.iterkeys():
        if not os.path.isabs(config[key]):
            config[key] = os.path.abspath(os.path.join(basedir, config[key]))
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)

    statements_path = os.path.abspath(os.path.join(output_dir, "statements.data"))
    hsql_path = os.path.abspath(os.path.join(output_dir, "hsql.data"))
    jni_path = os.path.abspath(os.path.join(output_dir, "jni.data"))
    template = config["template"]

    global normalize
    if "normalizer" in config:
        normalize = imp.load_source("normalizer", config["normalizer"]).normalize
    else:
        normalize = lambda x, y: x

    command = " ".join(args[2:])
    command += " schema=" + os.path.basename(config['ddl'])

    random_state = random.getstate()
    if "template-jni" in config:
        template = config["template-jni"]
    generator = SQLGenerator(config["schema"], template, True)
    counter = 0

    statements_file = open(statements_path, "wb")
    for i in generator.generate():
        cPickle.dump({"id": counter, "SQL": i}, statements_file)
        counter += 1
    statements_file.close()

    if run_once("jni", command, statements_path, jni_path) != 0:
        print >> sys.stderr, "Test with the JNI backend had errors."
        print >> sys.stderr, "  jni_path: %s" % (jni_path)
        sys.stderr.flush()
        exit(1)

    random.seed(random_seed)
    random.setstate(random_state)
    # To get around the timestamp issue. Volt and HSQLDB use different units
    # for timestamp (microsec vs. millisec), so we have to use different
    # template file for regression test, since all the statements are not
    # generated in this case.
    if "template-hsqldb" in config:
        template = config["template-hsqldb"]
    generator = SQLGenerator(config["schema"], template, False)
    counter = 0

    statements_file = open(statements_path, "wb")
    for i in generator.generate():
        cPickle.dump({"id": counter, "SQL": i}, statements_file)
        counter += 1
    statements_file.close()

    if run_once("hsqldb", command, statements_path, hsql_path) != 0:
        print >> sys.stderr, "Test with the HSQLDB backend had errors."
        exit(1)

    success = generate_html_reports(random_seed, statements_path, hsql_path,
                                    jni_path, output_dir, report_all)
    return success
Example #16
0
def run_config(config, basedir, output_dir, random_seed, report_all, args):
    for key in config.iterkeys():
        if not os.path.isabs(config[key]):
            config[key] = os.path.abspath(os.path.join(basedir, config[key]))
    report_filename = "report.xml"
    report_filename = os.path.abspath(os.path.join(output_dir, report_filename))
    template = config["template"]

    global normalize
    if "normalizer" in config:
        normalize = imp.load_source("normalizer", config["normalizer"]).normalize
    else:
        normalize = lambda x, y: x

    command = " ".join(args[2:])
    command += " schema=" + os.path.basename(config['ddl'])

    random_state = random.getstate()
    if "template-jni" in config:
        template = config["template-jni"]
    generator = SQLGenerator(config["schema"], template, True)
    statements = []
    counter = 0

    for i in generator.generate():
        statements.append({"id": counter,
                           "SQL": i})
        counter += 1

    if run_once("jni", command, statements) != 0:
        print >> sys.stderr, "Test with the JNI backend had errors."
        exit(1)

    random.seed(random_seed)
    random.setstate(random_state)
    # To get around the timestamp issue. Volt and HSQLDB use different units
    # for timestamp (microsec vs. millisec), so we have to use different
    # template file for regression test, since all the statements are not
    # generated in this case.
    if "template-hsqldb" in config:
        template = config["template-hsqldb"]
    generator = SQLGenerator(config["schema"], template, False)
    counter = 0

    for i in generator.generate():
        statements[counter]["SQL"] = i
        counter += 1

    if run_once("hsqldb", command, statements) != 0:
        print >> sys.stderr, "Test with the HSQLDB backend had errors."
        exit(1)

    report_dict = {"Seed": random_seed, "Statements": statements}
    report = XMLGenerator(report_dict)
    if not os.path.exists(output_dir):
        os.makedirs(output_dir)
    fd = open(report_filename, "w")
    fd.write(report.toXML())
    fd.close()

    success = generate_html_reports(report_dict, output_dir, report_all)
    return success