2015-03-06 17:35:00 +00:00
|
|
|
# Enable the tests
|
|
|
|
|
2014-10-11 21:57:45 +00:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2015-03-18 20:34:43 +00:00
|
|
|
set(CXX03_FLAGS "${CMAKE_CXX_FLAGS}")
|
2015-03-18 21:08:15 +00:00
|
|
|
string(REPLACE "-std=c++11" "-std=c++03" CXX03_FLAGS "${CXX03_FLAGS}")
|
|
|
|
string(REPLACE "-std=c++0x" "-std=c++03" CXX03_FLAGS "${CXX03_FLAGS}")
|
2015-03-18 20:34:43 +00:00
|
|
|
|
2015-03-06 17:35:00 +00:00
|
|
|
macro(compile_benchmark_test name)
|
|
|
|
add_executable(${name} "${name}.cc")
|
2015-03-10 03:30:14 +00:00
|
|
|
target_link_libraries(${name} benchmark ${CMAKE_THREAD_LIBS_INIT})
|
2015-03-06 17:35:00 +00:00
|
|
|
endmacro(compile_benchmark_test)
|
|
|
|
|
2014-04-23 07:47:07 +00:00
|
|
|
# Demonstration executable
|
2015-03-06 17:35:00 +00:00
|
|
|
compile_benchmark_test(benchmark_test)
|
2015-03-31 04:05:02 +00:00
|
|
|
add_test(benchmark benchmark_test --benchmark_min_time=0.01)
|
2014-04-23 07:56:17 +00:00
|
|
|
|
2015-03-10 03:30:14 +00:00
|
|
|
compile_benchmark_test(filter_test)
|
2015-03-31 04:05:02 +00:00
|
|
|
macro(add_filter_test name filter expect)
|
|
|
|
add_test(${name} filter_test --benchmark_min_time=0.01 --benchmark_filter=${filter} ${expect})
|
|
|
|
endmacro(add_filter_test)
|
|
|
|
|
|
|
|
add_filter_test(filter_simple "Foo" 3)
|
|
|
|
add_filter_test(filter_suffix "BM_.*" 4)
|
|
|
|
add_filter_test(filter_regex_all ".*" 5)
|
|
|
|
add_filter_test(filter_regex_blank "" 5)
|
|
|
|
add_filter_test(filter_regex_none "monkey" 0)
|
|
|
|
add_filter_test(filter_regex_wildcard ".*Foo.*" 3)
|
|
|
|
add_filter_test(filter_regex_begin "^BM_.*" 4)
|
|
|
|
add_filter_test(filter_regex_begin2 "^N" 1)
|
|
|
|
add_filter_test(filter_regex_end ".*Ba$" 1)
|
2015-03-12 22:03:33 +00:00
|
|
|
|
2015-03-27 03:37:26 +00:00
|
|
|
compile_benchmark_test(options_test)
|
2015-03-31 04:05:02 +00:00
|
|
|
add_test(options_benchmarks options_test --benchmark_min_time=0.01)
|
2015-03-27 03:37:26 +00:00
|
|
|
|
2015-03-12 22:03:33 +00:00
|
|
|
compile_benchmark_test(basic_test)
|
2015-03-31 04:05:02 +00:00
|
|
|
add_test(basic_benchmark basic_test --benchmark_min_time=0.01)
|
2015-03-18 20:34:43 +00:00
|
|
|
|
2015-04-06 21:00:06 +00:00
|
|
|
compile_benchmark_test(fixture_test)
|
|
|
|
add_test(fixture_test fixture_test --benchmark_min_time=0.01)
|
|
|
|
|
2015-03-18 20:34:43 +00:00
|
|
|
compile_benchmark_test(cxx03_test)
|
|
|
|
set_target_properties(cxx03_test
|
|
|
|
PROPERTIES COMPILE_FLAGS "${CXX03_FLAGS}")
|
2015-03-31 04:05:02 +00:00
|
|
|
add_test(cxx03 cxx03_test --benchmark_min_time=0.01)
|