Fix compiling tests.

This commit is contained in:
James Benton 2022-05-07 13:37:35 +01:00
parent e35c30b50f
commit 089fc5f42c
5 changed files with 12 additions and 14 deletions

View file

@ -19,6 +19,7 @@ set_target_properties(binrec PROPERTIES FOLDER libraries)
# catch
add_library(catch2 INTERFACE IMPORTED GLOBAL)
set_target_properties(catch2 PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CATCH_CONFIG_ENABLE_BENCHMARKING"
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/catch/single_include/catch2")
# cereal

View file

@ -7,7 +7,7 @@ add_executable(test-libcpu ${SOURCE_FILES} ${HEADER_FILES})
set_target_properties(test-libcpu PROPERTIES FOLDER tests)
target_link_libraries(test-libcpu
Catch2::Catch2
catch2
common
libcpu)

View file

@ -8,7 +8,7 @@ set_target_properties(test-gpu-tiling PROPERTIES FOLDER tests)
target_link_libraries(test-gpu-tiling
addrlib
Catch2::Catch2
catch2
common
libcpu
libgpu)

View file

@ -154,16 +154,15 @@ TEST_CASE("alibTilingPerf", "[!benchmark]")
auto addrLibImage = std::vector<uint8_t> { };
addrLibImage.resize(untiled.size());
auto benchTitle = fmt::format("processing ({} retiles)", pendingTests.size());
BENCHMARK(benchTitle)
BENCHMARK(fmt::format("processing ({} retiles)", pendingTests.size()))
{
for (auto& test : pendingTests) {
for (auto &test : pendingTests) {
// Compare image
addrLib.untileSlices(test.desc, 0,
untiled.data(), addrLibImage.data(),
test.firstSlice, test.numSlices);
untiled.data(), addrLibImage.data(),
test.firstSlice, test.numSlices);
}
}
};
}
struct PendingCpuPerfEntry
@ -222,8 +221,7 @@ TEST_CASE("cpuTilingPerf", "[!benchmark]")
static constexpr auto TestIterMulti = 10;
auto benchTitle = fmt::format("processing ({} retiles)", pendingTests.size() * TestIterMulti);
BENCHMARK(benchTitle)
BENCHMARK(fmt::format("processing ({} retiles)", pendingTests.size() * TestIterMulti))
{
for (auto i = 0; i < TestIterMulti; ++i) {
for (auto& test : pendingTests) {
@ -241,6 +239,6 @@ TEST_CASE("cpuTilingPerf", "[!benchmark]")
test.numSlices);
}
}
}
};
}

View file

@ -310,11 +310,10 @@ TEST_CASE("vkTilingPerf", "[!benchmark]")
endSyncCmdBuffer(cmdBuffer);
auto benchTitle = fmt::format("processing ({} retiles)", pendingTests.size());
BENCHMARK(benchTitle)
BENCHMARK(fmt::format("processing ({} retiles)", pendingTests.size()))
{
execSyncCmdBuffer(cmdBuffer);
}
};
freeSyncCmdBuffer(cmdBuffer);
}