benchmark/test/CMakeLists.txt

37 lines
1.3 KiB
CMake
Raw Normal View History

# Enable the tests
find_package(Threads REQUIRED)
2015-03-18 20:34:43 +00:00
set(CXX03_FLAGS "${CMAKE_CXX_FLAGS}")
2015-03-18 21:05:53 +00:00
separate_arguments(CXX03_FLAGS)
2015-03-18 20:34:43 +00:00
list(REMOVE_ITEM CXX03_FLAGS -std=c++11 -std=c++0x)
list(APPEND CXX03_FLAGS -std=c++03)
string(REPLACE ";" " " CXX03_FLAGS "${CXX03_FLAGS}")
macro(compile_benchmark_test name)
add_executable(${name} "${name}.cc")
target_link_libraries(${name} benchmark ${CMAKE_THREAD_LIBS_INIT})
endmacro(compile_benchmark_test)
# Demonstration executable
compile_benchmark_test(benchmark_test)
add_test(benchmark benchmark_test --benchmark_min_time=0.1)
compile_benchmark_test(filter_test)
add_test(filter_simple filter_test --benchmark_filter=Calculate 16)
add_test(filter_suffix filter_test --benchmark_filter=Calculate* 16)
add_test(filter_regex_all filter_test --benchmark_filter=.* 16)
add_test(filter_regex_blank filter_test --benchmark_filter= 16)
add_test(filter_regex_none filter_test --benchmark_filter=monkey 0)
add_test(filter_regex_wildcard filter_test --benchmark_filter=.*Calculate.* 16)
add_test(filter_regex_begin filter_test --benchmark_filter=^BM_Calculate.* 16)
add_test(filter_regex_end filter_test --benchmark_filter=.*Pi$ 8)
compile_benchmark_test(basic_test)
add_test(basic basic_test)
2015-03-18 20:34:43 +00:00
compile_benchmark_test(cxx03_test)
set_target_properties(cxx03_test
PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}")
add_test(cxx03 cxx03_test)