Silence google benchmark CMake output, remove benchmark tests

This commit is contained in:
Teddy Reed 2015-07-24 09:52:29 -07:00
parent 5cd9adae15
commit af13c1b7ea
5 changed files with 51 additions and 40 deletions

View File

@ -1,2 +1,8 @@
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/third-party/benchmark/include") set(BENCHMARK_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/benchmark")
ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/third-party/benchmark") set(BENCHMARK_BUILD_DIR "${CMAKE_BINARY_DIR}/third-party/benchmark")
# Only build the benchmark shared library for benchmark targets.
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "")
INCLUDE_DIRECTORIES("${BENCHMARK_SOURCE_DIR}/include")
ADD_SUBDIRECTORY("${BENCHMARK_SOURCE_DIR}")

View File

@ -378,10 +378,3 @@ add_custom_target(
COMMENT "Generating sdk sync: ${CMAKE_BINARY_DIR}/sync" COMMENT "Generating sdk sync: ${CMAKE_BINARY_DIR}/sync"
DEPENDS osquery_extensions osquery_amalgamation DEPENDS osquery_extensions osquery_amalgamation
) )
# make benchmark
add_custom_target(
run-benchmark
COMMAND sudo bash -c "$<TARGET_FILE:osquery_benchmarks> $ENV{BENCHMARK_TO_FILE}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)

View File

@ -1,4 +1,3 @@
# Set includes/compile options for kernel modules/extensions. # Set includes/compile options for kernel modules/extensions.
set(CMAKE_C_FLAGS "") set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "") set(CMAKE_CXX_FLAGS "")
@ -159,6 +158,7 @@ if(APPLE)
COMMENT "Generating symbols and launching a debugger with kernel target..." COMMENT "Generating symbols and launching a debugger with kernel target..."
) )
if(NOT DEFINED ENV{SKIP_TESTS})
add_custom_target( add_custom_target(
kernel-test kernel-test
COMMAND echo "" COMMAND echo ""
@ -173,6 +173,7 @@ if(APPLE)
COMMAND sudo bash -c "$<TARGET_FILE:osquery_kernel_benchmarks> $ENV{BENCHMARK_TO_FILE}" COMMAND sudo bash -c "$<TARGET_FILE:osquery_kernel_benchmarks> $ENV{BENCHMARK_TO_FILE}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
) )
endif()
elseif(LINUX) elseif(LINUX)
add_custom_target( add_custom_target(
base_kernel base_kernel
@ -199,6 +200,7 @@ elseif(LINUX)
COMMAND echo "-- No kernel unload for Linux" COMMAND echo "-- No kernel unload for Linux"
) )
if(NOT DEFINED ENV{SKIP_TESTS})
add_custom_target( add_custom_target(
kernel-test kernel-test
COMMAND echo "-- No kernel test is run for Linux" COMMAND echo "-- No kernel test is run for Linux"
@ -208,6 +210,7 @@ elseif(LINUX)
run-kernel-benchmark run-kernel-benchmark
COMMAND echo "-- No kernel benchmark is run for Linux" COMMAND echo "-- No kernel benchmark is run for Linux"
) )
endif()
else() else()
add_custom_target( add_custom_target(
base_kernel base_kernel
@ -234,6 +237,7 @@ else()
COMMAND echo "-- No kernel unload for unsupported platform" COMMAND echo "-- No kernel unload for unsupported platform"
) )
if(NOT DEFINED ENV{SKIP_TESTS})
add_custom_target( add_custom_target(
kernel-test kernel-test
COMMAND echo "-- No kernel test is run for unsupported platform" COMMAND echo "-- No kernel test is run for unsupported platform"
@ -243,6 +247,7 @@ else()
run-kernel-benchmark run-kernel-benchmark
COMMAND echo "-- No kernel benchmark is run for unsupported platform" COMMAND echo "-- No kernel benchmark is run for unsupported platform"
) )
endif()
endif() endif()
# make kernel-build # make kernel-build

View File

@ -218,6 +218,13 @@ if(NOT DEFINED ENV{SKIP_TESTS})
target_link_libraries(osquery_kernel_benchmarks benchmark libosquery_testing) target_link_libraries(osquery_kernel_benchmarks benchmark libosquery_testing)
SET_OSQUERY_COMPILE(osquery_kernel_benchmarks "${CXX_COMPILE_FLAGS} -DKERNEL_TEST=1") SET_OSQUERY_COMPILE(osquery_kernel_benchmarks "${CXX_COMPILE_FLAGS} -DKERNEL_TEST=1")
# make benchmark
add_custom_target(
run-benchmark
COMMAND sudo bash -c "$<TARGET_FILE:osquery_benchmarks> $ENV{BENCHMARK_TO_FILE}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)
if(NOT OSQUERY_BUILD_SDK_ONLY) if(NOT OSQUERY_BUILD_SDK_ONLY)
# osquery core (additional) set of unit tests built outside of SDK. # osquery core (additional) set of unit tests built outside of SDK.
add_executable(osquery_additional_tests main/tests.cpp ${OSQUERY_ADDITIONAL_TESTS}) add_executable(osquery_additional_tests main/tests.cpp ${OSQUERY_ADDITIONAL_TESTS})

@ -1 +1 @@
Subproject commit 5f150180d1ad74b1b6b4bf0d2ec4814645d902ec Subproject commit 9d40527bd35654ffd4a39a07fcaa6623329710dd