Esempio n. 1
0
def make_c_test(environment, filename):
    setup_c_environment(environment, filename)
    environment.executable = environment.builddir + "/" + environment.filename + ".exe"
    ensure_dir(os.path.dirname(environment.executable))

    test = Test(environment, filename)

    compile = test.add_step("compile", step_compile_c)
    compile.add_check(check_cparser_problems)
    compile.add_check(check_no_errors)
    compile.add_check(check_firm_problems)
    compile.add_check(check_retcode_zero)
    compile.add_check(check_memcheck_output)

    asmchecks = parse_embedded_commands(environment, environment.filename)
    if asmchecks:
        environment.asmfile = environment.builddir + "/" + environment.filename + ".s"
        ensure_dir(os.path.dirname(environment.asmfile))
        asm = test.add_step("asm", step_compile_c_asm)
        asm.add_checks(asmchecks)

    if environment.memcheck:
        return test # no execute necessary
    execute = test.add_step("execute", step_execute)
    execute.add_check(check_retcode_zero)
    execute.add_check(create_check_reference_output(environment))
    return test
Esempio n. 2
0
def parse_embedded_commands_no_check(environment):
    checks = parse_embedded_commands(environment, environment.filename)
    if checks:
        raise Exception("embedded checks not allowed")