2015-03-07 01:35:00 +08:00
|
|
|
# Enable the tests
|
|
|
|
|
2014-10-12 05:57:45 +08:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2015-03-07 01:35:00 +08:00
|
|
|
macro(compile_benchmark_test name)
|
|
|
|
add_executable(${name} "${name}.cc")
|
2015-03-10 11:30:14 +08:00
|
|
|
target_link_libraries(${name} benchmark ${CMAKE_THREAD_LIBS_INIT})
|
2015-03-07 01:35:00 +08:00
|
|
|
endmacro(compile_benchmark_test)
|
|
|
|
|
2014-04-23 15:47:07 +08:00
|
|
|
# Demonstration executable
|
2015-03-07 01:35:00 +08:00
|
|
|
compile_benchmark_test(benchmark_test)
|
2015-03-11 02:38:45 +08:00
|
|
|
add_test(benchmark benchmark_test --benchmark_min_time=0.1)
|
2014-04-23 15:56:17 +08:00
|
|
|
|
2015-03-10 11:30:14 +08:00
|
|
|
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)
|
2015-03-13 06:03:33 +08:00
|
|
|
|
|
|
|
compile_benchmark_test(basic_test)
|
|
|
|
add_test(basic basic_test)
|