celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject [2/4] celix git commit: CELIX-237: Removed Test.cmake. refactored using cmake standard add_test instead
Date Wed, 08 Jul 2015 08:37:47 GMT
CELIX-237: Removed Test.cmake. refactored using cmake standard add_test instead


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/2837cf13
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/2837cf13
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/2837cf13

Branch: refs/heads/feature/CELIX-237_rsa-ffi
Commit: 2837cf1340d00d689554efc1bc45a2bd4655e640
Parents: 1cab784
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Wed Jul 8 10:08:25 2015 +0200
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Wed Jul 8 10:08:25 2015 +0200

----------------------------------------------------------------------
 cmake/CMakeCelix.cmake                          |  2 +-
 cmake/cmake_celix/Test.cmake                    | 52 --------------------
 framework/CMakeLists.txt                        | 44 ++++++++---------
 .../dynamic_function_interface/CMakeLists.txt   |  2 +-
 .../dynamic_function_interface/dyn_type.h       |  2 +
 utils/CMakeLists.txt                            | 12 ++---
 6 files changed, 32 insertions(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/2837cf13/cmake/CMakeCelix.cmake
----------------------------------------------------------------------
diff --git a/cmake/CMakeCelix.cmake b/cmake/CMakeCelix.cmake
index 40221b8..1db74b4 100644
--- a/cmake/CMakeCelix.cmake
+++ b/cmake/CMakeCelix.cmake
@@ -23,6 +23,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 include(cmake_celix/Dependencies)
 include(cmake_celix/Packaging)
-include(cmake_celix/Test)
+#include(cmake_celix/Test)
 include(cmake_celix/ApacheRat)
 include(cmake_celix/CodeCoverage)

http://git-wip-us.apache.org/repos/asf/celix/blob/2837cf13/cmake/cmake_celix/Test.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/Test.cmake b/cmake/cmake_celix/Test.cmake
deleted file mode 100644
index 20b3d3d..0000000
--- a/cmake/cmake_celix/Test.cmake
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-FUNCTION(ADD_TARGET_FOR_TEST _testrunner)
-	#add_test(NAME ${_testrunner} 
-    #			COMMAND ${_testrunner} -ojunit)
-    			
-    ADD_TEST(ctest_build_${_testrunner} "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target
${_testrunner})
-    ADD_TEST(ctest_run_${_testrunner} ${_testrunner} -ojunit)
-    SET_TESTS_PROPERTIES ( ctest_run_${_testrunner} PROPERTIES DEPENDS ctest_build_${_testrunner})
-    			
-	string(LENGTH ${_testrunner} length)
-	math(EXPR l "${length} - 5")
-	string(SUBSTRING ${_testrunner} 0 ${l} output)
-    		
-	GET_DIRECTORY_PROPERTY(PROPS ADDITIONAL_MAKE_CLEAN_FILES)	
-	SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROPS};${CMAKE_CURRENT_BINARY_DIR}/cpputest_${output}.xml")
-ENDFUNCTION() # ADD_TARGET_FOR_TEST
-
-include(FindCUnit)
-
-ADD_CUSTOM_TARGET(test_cunit)
-MACRO(run_test)
-    PARSE_ARGUMENTS(TEST "" "" ${ARGN})
-    LIST(GET TEST_DEFAULT_ARGS 0 EXEC)
-	
-	SET(__testTarget test_${EXEC})
-	
-	make_directory(${PROJECT_BINARY_DIR}/test_results)
-		
-	add_custom_target(${__testTarget}
-		${EXEC} ${EXEC} 
-		COMMAND if \\[ -e ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml \\]\; then xsltproc
--path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-Run.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Results.xml
> ${EXEC}-Results.html \; fi
-		COMMAND if \\[ -e ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml \\]\; then xsltproc
--path ${CUNIT_SHARE_DIR} ${CUNIT_SHARE_DIR}/CUnit-List.xsl ${PROJECT_BINARY_DIR}/test_results/${EXEC}-Listing.xml
> ${EXEC}-Listing.html \; fi
-		WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/test_results
-	)
-	ADD_DEPENDENCIES(test_cunit ${__testTarget})
-ENDMACRO(run_test)

http://git-wip-us.apache.org/repos/asf/celix/blob/2837cf13/framework/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt
index 337c82d..1719d2c 100644
--- a/framework/CMakeLists.txt
+++ b/framework/CMakeLists.txt
@@ -326,29 +326,29 @@ if (FRAMEWORK)
 		
 		set_target_properties(wire_test PROPERTIES COMPILE_FLAGS "-include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorMallocMacros.h
-include ${CPPUTEST_INCLUDE_DIR}/CppUTest/MemoryLeakDetectorNewMacros.h")
 		
-        ADD_TARGET_FOR_TEST(attribute_test)
-        ADD_TARGET_FOR_TEST(bundle_archive_test)
+        add_test(NAME framework_test_1 COMMAND attribute_test)
+        add_test(NAME framework_test_2 COMMAND bundle_archive_test)
         #ADD_TARGET_FOR_TEST(bundle_cache_test)
-        ADD_TARGET_FOR_TEST(bundle_context_test)
-        ADD_TARGET_FOR_TEST(bundle_revision_test)
-        ADD_TARGET_FOR_TEST(bundle_test)
-        ADD_TARGET_FOR_TEST(capability_test)
-        ADD_TARGET_FOR_TEST(filter_test)
-        ADD_TARGET_FOR_TEST(framework_test)
-        ADD_TARGET_FOR_TEST(manifest_parser_test)
-        ADD_TARGET_FOR_TEST(manifest_test)
-        ADD_TARGET_FOR_TEST(module_test)
-        ADD_TARGET_FOR_TEST(properties_test)
-        ADD_TARGET_FOR_TEST(requirement_test)
-        ADD_TARGET_FOR_TEST(resolver_test)
-        ADD_TARGET_FOR_TEST(service_reference_test)
-        ADD_TARGET_FOR_TEST(service_registration_test)
-        ADD_TARGET_FOR_TEST(service_registry_test)
-        ADD_TARGET_FOR_TEST(service_tracker_customizer_test)
-        ADD_TARGET_FOR_TEST(service_tracker_test)
-        ADD_TARGET_FOR_TEST(version_range_test)
-        ADD_TARGET_FOR_TEST(version_test)
-	    ADD_TARGET_FOR_TEST(wire_test)
+        add_test(NAME framework_test_3 COMMAND bundle_context_test)
+        add_test(NAME framework_test_4 COMMAND bundle_revision_test)
+        add_test(NAME framework_test_5 COMMAND bundle_test)
+        add_test(NAME framework_test_6 COMMAND capability_test)
+        add_test(NAME framework_test_7 COMMAND filter_test)
+        add_test(NAME framework_test_8 COMMAND framework_test)
+        add_test(NAME framework_test_9 COMMAND manifest_parser_test)
+        add_test(NAME framework_test_10 COMMAND manifest_test)
+        add_test(NAME framework_test_11 COMMAND module_test)
+        add_test(NAME framework_test_12 COMMAND properties_test)
+        add_test(NAME framework_test_13 COMMAND requirement_test)
+        add_test(NAME framework_test_14 COMMAND resolver_test)
+        add_test(NAME framework_test_15 COMMAND service_reference_test)
+        add_test(NAME framework_test_16 COMMAND service_registration_test)
+        add_test(NAME framework_test_17 COMMAND service_registry_test)
+        add_test(NAME framework_test_18 COMMAND service_tracker_customizer_test)
+        add_test(NAME framework_test_19 COMMAND service_tracker_test)
+        add_test(NAME framework_test_20 COMMAND version_range_test)
+        add_test(NAME framework_test_21 COMMAND version_test)
+	    add_test(NAME framework_test_22 COMMAND wire_test)
 	    
         SETUP_TARGET_FOR_COVERAGE(version_test_c version_test ${CMAKE_BINARY_DIR}/coverage/version_test)
         SETUP_TARGET_FOR_COVERAGE(version_range_test_c version_range_test ${CMAKE_BINARY_DIR}/coverage/version_range_test)

http://git-wip-us.apache.org/repos/asf/celix/blob/2837cf13/remote_services/dynamic_function_interface/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/CMakeLists.txt b/remote_services/dynamic_function_interface/CMakeLists.txt
index f1a8890..06720dd 100644
--- a/remote_services/dynamic_function_interface/CMakeLists.txt
+++ b/remote_services/dynamic_function_interface/CMakeLists.txt
@@ -44,6 +44,6 @@ target_link_libraries(dfi ${FFI_LIBRARIES} ${JANSSON_LIBRARY})
 	)
 	add_dependencies(dfi_tests copy-input)
 
-	ADD_TARGET_FOR_TEST(dfi_tests)
+    add_test(NAME run_dfi_tests COMMAND dfi_tests)
 	SETUP_TARGET_FOR_COVERAGE(dfi_tests_cov dfi_tests ${CMAKE_BINARY_DIR}/coverage/dfi)
 #endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/2837cf13/remote_services/dynamic_function_interface/dyn_type.h
----------------------------------------------------------------------
diff --git a/remote_services/dynamic_function_interface/dyn_type.h b/remote_services/dynamic_function_interface/dyn_type.h
index 1641bae..42319ad 100644
--- a/remote_services/dynamic_function_interface/dyn_type.h
+++ b/remote_services/dynamic_function_interface/dyn_type.h
@@ -108,6 +108,8 @@ struct complex_type_entry {
     TAILQ_ENTRY(complex_type_entry) entries;
 };
 
+TAILQ_HEAD(dyn_type_list_head, nested_entry); 
+
 struct nested_entry {
     dyn_type type;
     TAILQ_ENTRY(nested_entry) entries;

http://git-wip-us.apache.org/repos/asf/celix/blob/2837cf13/utils/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index a6b2f4f..862cf2d 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -44,7 +44,7 @@ if (UTILS)
 	)
     
     IF(UNIX)
-    	target_link_libraries(celix_utils m)
+    	target_link_libraries(celix_utils m pthread)
     ENDIF(UNIX)
     
     install(TARGETS celix_utils DESTINATION lib COMPONENT framework)
@@ -75,12 +75,12 @@ if (UTILS)
 	    add_executable(linked_list_test private/test/linked_list_test.c)
 	    target_link_libraries(linked_list_test celix_utils ${CUNIT_LIBRARIES})
 
-	    run_test(array_list_test2)
-	    run_test(hash_map_test)
-	    run_test(hash_map_test_hash)
-	    run_test(linked_list_test)
+        add_test(NAME util_test_1 COMMAND array_list_test2)
+	    add_test(NAME util_test_2 COMMAND hash_map_test)
+	    add_test(NAME util_test_3 COMMAND hash_map_test_hash)
+	    add_test(NAME util_test_4 COMMAND linked_list_test)
+        add_test(NAME util_test_5 COMMAND array_list_test)
 	    
-	    ADD_TARGET_FOR_TEST(array_list_test)
         SETUP_TARGET_FOR_COVERAGE(array_list_test_c array_list_test ${CMAKE_BINARY_DIR}/coverage/array_list_test)
     endif(UTILS-TESTS)
 endif (UTILS)


Mime
View raw message