Skip to content

Commit

Permalink
性能测试改为优先 find_package,查找失败才自动下载
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoxi-scut committed Apr 12, 2024
1 parent d6a282d commit 46e5b44
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cmake/RMVLCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ endif()
option(BUILD_PERF_TESTS "Build performance tests" OFF)
if(BUILD_PERF_TESTS)
enable_testing()
set(BENCHMARK_ENABLE_TESTING OFF)
rmvl_download(benchmark GIT "https://github.com/google/benchmark.git : v1.8.0")
find_package(benchmark QUIET)
if(NOT benchmark_FOUND)
set(BENCHMARK_ENABLE_TESTING OFF)
rmvl_download(benchmark GIT "https://github.com/google/benchmark.git : v1.8.0")
endif()
endif(BUILD_PERF_TESTS)
2 changes: 2 additions & 0 deletions cmake/RMVLModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ function(rmvl_add_test test_name test_kind)
${the_target}
PRIVATE ${TS_DEPEND_TESTS}
)

# Add test
if("${test_kind_lower}" STREQUAL "unit")
gtest_discover_tests(
${the_target}
Expand Down
2 changes: 0 additions & 2 deletions modules/imgproc/perf/perf_pretreat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*/

#include <benchmark/benchmark.h>
#include <iostream>
#include <tuple>

#include <opencv2/imgproc.hpp>

Expand Down

0 comments on commit 46e5b44

Please sign in to comment.