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
def make_fluffy_should_fail(environment, filename): environment.filename = 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_fluffy) compile.add_check(check_missing_errors) return test
def make_fluffy_test(environment, filename): environment.filename = 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_fluffy) compile.add_check(check_no_errors) compile.add_check(check_firm_problems) compile.add_check(check_retcode_zero) execute = test.add_step("execute", step_execute) execute.add_check(check_retcode_zero) execute.add_check(create_check_reference_output(environment)) return test
def make_perftest(environment, filename, size, check_perf): setup_c_environment(environment, filename) environment.executable = environment.builddir + "/" + environment.filename + ".exe" ensure_dir(os.path.dirname(environment.executable)) if size != 0: environment.executionargs = " %s" % size 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) execute = test.add_step("execute", step_execute) execute.add_check(check_retcode_zero) execute.add_check(check_perf) return test