This repository was archived by the owner on Aug 5, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +593
-0
lines changed Expand file tree Collapse file tree 3 files changed +593
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ after_success:
4747 --exclude "skeleton-subsystem"
4848 --exclude "test/test-subsystem"
4949 --exclude "bindings/c/Test.cpp"
50+ --exclude "parameter/criterion/test/"
5051 --exclude "test/tokenizer"
5152 --gcov-options '\--long-file-names --preserve-paths'
5253
Original file line number Diff line number Diff line change @@ -38,10 +38,33 @@ include_directories(
3838 "${PROJECT_SOURCE_DIR} /xmlserializer/"
3939 "${PROJECT_SOURCE_DIR} /utility/" )
4040
41+ target_link_libraries (criterion pfw_utility xmlserializer)
42+
4143# '-fPIC' needed for linking against shared libraries (e.g. libparameter)
4244set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
4345
4446# Client headers
4547install (FILES
4648 include /criterion/client/CriterionInterface.h
4749 DESTINATION "include/parameter/criterion/client" )
50+
51+ if (BUILD_TESTING)
52+ # Catch header provided by Ubuntu package is not up to date and need
53+ # CATCH_CONFIG_CPP11_NULLPTR flag activated to compare a pointer to nullptr
54+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCATCH_CONFIG_CPP11_NULLPTR" )
55+
56+ find_path (CATCH_HEADER catch.hpp)
57+ include_directories (
58+ include
59+ ${CATCH_HEADER} )
60+
61+ # Add unit test
62+ add_executable (criterionUnitTest test /CriterionUnitTest.cpp)
63+
64+ target_link_libraries (criterionUnitTest criterion)
65+ add_test (NAME criterionUnitTest
66+ COMMAND criterionUnitTest)
67+
68+ # Custom function defined in the top-level CMakeLists
69+ set_test_env(criterionUnitTest)
70+ endif ()
You can’t perform that action at this time.
0 commit comments