mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
0dc77e104f
This class introduces the `RunningStatistics` class, which allows to compute the mean and standard deviation of a set of numbers. These values are computed incrementally and can be associated to a name. The values computed by `RunningStatistics` can be dumped upon regular program termination, `SIGABRT` and `SIGINT`. In practice they are printed at the end of the program execution, even in case of asserts and `Ctrl + C`. Moreover, `SIGUSR1` is used to trigger printing the statistics without crashing the program.
32 lines
1.6 KiB
CMake
32 lines
1.6 KiB
CMake
#
|
|
# This file is distributed under the MIT License. See LICENSE.md for details.
|
|
#
|
|
|
|
cmake_policy(SET CMP0060 NEW)
|
|
|
|
set(SRC "${CMAKE_SOURCE_DIR}/tests/Unit")
|
|
|
|
set(Boost_ADDITIONAL_VERSIONS "1.63" "1.63.0")
|
|
find_package(Boost 1.63.0 REQUIRED COMPONENTS unit_test_framework)
|
|
|
|
add_executable(test_lazysmallbitvector
|
|
"${SRC}/lazysmallbitvector.cpp")
|
|
target_include_directories(test_lazysmallbitvector PRIVATE "${CMAKE_SOURCE_DIR}" "${Boost_INCLUDE_DIRS}")
|
|
target_compile_definitions(test_lazysmallbitvector PRIVATE "BOOST_TEST_DYN_LINK=1")
|
|
target_link_libraries(test_lazysmallbitvector ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
|
|
add_test(NAME test_lazysmallbitvector COMMAND test_lazysmallbitvector)
|
|
|
|
add_executable(test_stackanalysis "${SRC}/stackanalysis.cpp" "${CMAKE_SOURCE_DIR}/debug.cpp" "${CMAKE_SOURCE_DIR}/statistics.cpp")
|
|
target_include_directories(test_stackanalysis PRIVATE "${CMAKE_SOURCE_DIR}" "${Boost_INCLUDE_DIRS}")
|
|
target_compile_definitions(test_stackanalysis PRIVATE "BOOST_TEST_DYN_LINK=1")
|
|
target_link_libraries(test_stackanalysis ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${LLVM_LIBRARIES})
|
|
add_test(NAME test_stackanalysis COMMAND test_stackanalysis)
|
|
|
|
add_executable(test_classsentinel
|
|
"${SRC}/classsentinel.cpp"
|
|
"${CMAKE_SOURCE_DIR}/debug.cpp")
|
|
target_include_directories(test_classsentinel PRIVATE "${CMAKE_SOURCE_DIR}" "${Boost_INCLUDE_DIRS}")
|
|
target_compile_definitions(test_classsentinel PRIVATE "BOOST_TEST_DYN_LINK=1")
|
|
target_link_libraries(test_classsentinel ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${LLVM_LIBRARIES})
|
|
add_test(NAME test_classsentinel COMMAND test_classsentinel)
|