Repository: celix Updated Branches: refs/heads/feature/CELIX-426-cxx-api 764bd7f7a -> 6f17344c4
CELIX-426: Fixes somes issues with test configuration Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6f17344c Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6f17344c Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6f17344c Branch: refs/heads/feature/CELIX-426-cxx-api Commit: 6f17344c4d0eae937a0d8f40732771a33f5e3171 Parents: 764bd7f Author: Pepijn Noltes <[email protected]> Authored: Sun May 6 21:15:06 2018 +0200 Committer: Pepijn Noltes <[email protected]> Committed: Sun May 6 21:15:06 2018 +0200 ---------------------------------------------------------------------- cmake/celix_project/AddGTest.cmake | 5 ++++- framework/gtest/CMakeLists.txt | 6 +++++- framework/private/mock/framework_mock.c | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/6f17344c/cmake/celix_project/AddGTest.cmake ---------------------------------------------------------------------- diff --git a/cmake/celix_project/AddGTest.cmake b/cmake/celix_project/AddGTest.cmake index 60705ed..5573c7e 100644 --- a/cmake/celix_project/AddGTest.cmake +++ b/cmake/celix_project/AddGTest.cmake @@ -25,6 +25,8 @@ ExternalProject_Add( ) ExternalProject_Get_Property(googletest_project source_dir binary_dir) + +file(MAKE_DIRECTORY ${source_dir}/googletest/include) add_library(gtest IMPORTED STATIC GLOBAL) add_dependencies(gtest googletest_project) set_target_properties(gtest PROPERTIES @@ -32,9 +34,10 @@ set_target_properties(gtest PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${source_dir}/googletest/include" ) +file(MAKE_DIRECTORY ${source_dir}/googlemock/include) add_library(gmock IMPORTED STATIC GLOBAL) add_dependencies(gmock googletest_project) set_target_properties(gmock PROPERTIES IMPORTED_LOCATION "${binary_dir}/googlemock/libgmock.a" INTERFACE_INCLUDE_DIRECTORIES "${source_dir}/googlemock/include" -) \ No newline at end of file +) http://git-wip-us.apache.org/repos/asf/celix/blob/6f17344c/framework/gtest/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/framework/gtest/CMakeLists.txt b/framework/gtest/CMakeLists.txt index a768f3f..4ecd47a 100644 --- a/framework/gtest/CMakeLists.txt +++ b/framework/gtest/CMakeLists.txt @@ -34,4 +34,8 @@ add_celix_bundle(cxx_fwm_test_bundle1 add_custom_command(TARGET cxx_framework_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_PROPERTY:cxx_fwm_test_bundle1,BUNDLE_FILE> ${CMAKE_CURRENT_BINARY_DIR}/bundle1.zip ) -add_celix_bundle_dependencies(cxx_framework_tests cxx_fwm_test_bundle1) \ No newline at end of file +add_celix_bundle_dependencies(cxx_framework_tests cxx_fwm_test_bundle1) + + +add_test(NAME cxx_framework_tests COMMAND cxx_framework_tests) +SETUP_TARGET_FOR_COVERAGE(cxx_framework_tests_cov cxx_framework_tests ${CMAKE_BINARY_DIR}/coverage/cxx_framework_tests/cxx_framework_tests) http://git-wip-us.apache.org/repos/asf/celix/blob/6f17344c/framework/private/mock/framework_mock.c ---------------------------------------------------------------------- diff --git a/framework/private/mock/framework_mock.c b/framework/private/mock/framework_mock.c index d718ade..5aa06d3 100644 --- a/framework/private/mock/framework_mock.c +++ b/framework/private/mock/framework_mock.c @@ -327,12 +327,13 @@ void celix_framework_useBundles(framework_t *fw, void *callbackHandle, void(*use ->withPointerParameters("use", use); } -void celix_framework_useBundle(framework_t *fw, long bundleId, void *callbackHandle, void(*use)(void *handle, const bundle_t *bnd)) { +bool celix_framework_useBundle(framework_t *fw, long bundleId, void *callbackHandle, void(*use)(void *handle, const bundle_t *bnd)) { mock_c()->actualCall("celix_framework_useBundle") ->withPointerParameters("fw", fw) ->withLongIntParameters("bundleId", bundleId) ->withPointerParameters("callbackHandle", callbackHandle) ->withPointerParameters("use", use); + return mock_c()->returnValue().value.boolValue; }
