mirror of
https://github.com/lefticus/6502-cpp.git
synced 2025-10-31 12:16:09 +00:00
Use test templates to multiply out the versions I want
This commit is contained in:
@@ -58,8 +58,11 @@ quit
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
REQUIRE(system(fmt::format("{} -f {} -t C64 {}", mos6502_cpp_executable, source_filename, optimization_level).c_str()) == EXIT_SUCCESS);
|
REQUIRE(system(fmt::format("{} -f {} -t C64 {}", mos6502_cpp_executable, source_filename, optimization_level).c_str())
|
||||||
REQUIRE(system(fmt::format("xvfb-run -d {} +saveres -warp -moncommands {}", x64_executable, vice_script_filename).c_str()) == EXIT_SUCCESS);
|
== EXIT_SUCCESS);
|
||||||
|
REQUIRE(
|
||||||
|
system(fmt::format("xvfb-run -d {} +vsync -sounddev dummy +saveres -warp -moncommands {}", x64_executable, vice_script_filename).c_str())
|
||||||
|
== EXIT_SUCCESS);
|
||||||
|
|
||||||
std::ifstream memory_dump(ram_dump_filename, std::ios::binary);
|
std::ifstream memory_dump(ram_dump_filename, std::ios::binary);
|
||||||
|
|
||||||
@@ -71,7 +74,14 @@ quit
|
|||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Can write to screen memory")
|
TEMPLATE_TEST_CASE_SIG("Can write to screen memory",
|
||||||
|
"",
|
||||||
|
((OptimizationLevel O), O),
|
||||||
|
OptimizationLevel::Os,
|
||||||
|
OptimizationLevel::O0,
|
||||||
|
OptimizationLevel::O1,
|
||||||
|
OptimizationLevel::O2,
|
||||||
|
OptimizationLevel::O3)
|
||||||
{
|
{
|
||||||
constexpr static std::string_view program =
|
constexpr static std::string_view program =
|
||||||
R"(
|
R"(
|
||||||
@@ -81,14 +91,20 @@ int main()
|
|||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|
||||||
const auto o_level = GENERATE(OptimizationLevel::O0, OptimizationLevel::O1, OptimizationLevel::O2, OptimizationLevel::O3, OptimizationLevel::Os);
|
const auto result = execute_c64_program("write_to_screen_memory", program, O, 0x400, 0x400);
|
||||||
const auto result = execute_c64_program("write_to_screen_memory", program, o_level, 0x400, 0x400);
|
|
||||||
|
|
||||||
REQUIRE(result.size() == 1);
|
REQUIRE(result.size() == 1);
|
||||||
CHECK(result[0] == 10);
|
CHECK(result[0] == 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Can write to screen memory via function call")
|
TEMPLATE_TEST_CASE_SIG("Can write to screen memory via function call",
|
||||||
|
"",
|
||||||
|
((OptimizationLevel O), O),
|
||||||
|
OptimizationLevel::Os,
|
||||||
|
OptimizationLevel::O0,
|
||||||
|
OptimizationLevel::O1,
|
||||||
|
OptimizationLevel::O2,
|
||||||
|
OptimizationLevel::O3)
|
||||||
{
|
{
|
||||||
constexpr static std::string_view program =
|
constexpr static std::string_view program =
|
||||||
R"(
|
R"(
|
||||||
@@ -104,9 +120,7 @@ int main()
|
|||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|
||||||
const auto o_level = GENERATE(
|
const auto result = execute_c64_program("write_to_screen_memory_via_function", program, O, 0x400, 0x401);
|
||||||
OptimizationLevel::O0, OptimizationLevel::O1, OptimizationLevel::O2, OptimizationLevel::O3, OptimizationLevel::Os);
|
|
||||||
const auto result = execute_c64_program("write_to_screen_memory_via_function", program, o_level, 0x400, 0x401);
|
|
||||||
|
|
||||||
REQUIRE(result.size() == 2);
|
REQUIRE(result.size() == 2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user