diff --git a/CMakeLists.txt b/CMakeLists.txt index 615a38d..077e2d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,6 +180,9 @@ endif() if(${ENABLE_TESTING}) find_package(Check REQUIRED) + if(NOT CHECK_LIBRARIES) + set(CHECK_LIBRARIES Check::check) + endif() include(CTest) endif() diff --git a/backends/open62541/tests/CMakeLists.txt b/backends/open62541/tests/CMakeLists.txt index b4a5740..f0555f9 100644 --- a/backends/open62541/tests/CMakeLists.txt +++ b/backends/open62541/tests/CMakeLists.txt @@ -1,90 +1,90 @@ add_executable(import import.c) target_include_directories(import PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(import PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(import PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME import_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND import ${PROJECT_SOURCE_DIR}/nodesets/testNodeset100nodes.xml) add_executable(namespaceZeroValues namespaceZeroValues.c) target_include_directories(namespaceZeroValues PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(namespaceZeroValues PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(namespaceZeroValues PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME namespaceZeroValues_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND namespaceZeroValues ${CMAKE_CURRENT_SOURCE_DIR}/namespaceZeroValues.xml) add_executable(customTypesWithValues customTypesWithValues.c) target_include_directories(customTypesWithValues PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(customTypesWithValues PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(customTypesWithValues PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME customTypesWithValues_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND customTypesWithValues ${CMAKE_CURRENT_SOURCE_DIR}/customTypesWithValues.xml) add_executable(subDataTypes subDataTypes.c) target_include_directories(subDataTypes PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(subDataTypes PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(subDataTypes PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME subDataTypes_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND subDataTypes ${CMAKE_CURRENT_SOURCE_DIR}/subDataTypes.xml) add_executable(valueRank valueRank.c) target_include_directories(valueRank PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(valueRank PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(valueRank PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME valueRank_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND valueRank ${CMAKE_CURRENT_SOURCE_DIR}/valueRank.xml) add_executable(basicNodeClasses basicNodeClasses.c) target_include_directories(basicNodeClasses PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(basicNodeClasses PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(basicNodeClasses PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME basicNodeClasses_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND basicNodeClasses ${CMAKE_CURRENT_SOURCE_DIR}/basicNodeClasses.xml) add_executable(issue_201 issue_201.c) target_include_directories(issue_201 PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(issue_201 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(issue_201 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME issue_201_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND issue_201 ${CMAKE_CURRENT_SOURCE_DIR}/issue_201.xml) add_executable(issue_241 issue_241.c) target_include_directories(issue_241 PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(issue_241 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(issue_241 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME issue_241_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND issue_241 ${CMAKE_CURRENT_SOURCE_DIR}/issue_241.xml) add_executable(stringNodeId_issue_224 stringNodeId_issue_224.c) target_include_directories(stringNodeId_issue_224 PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(stringNodeId_issue_224 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(stringNodeId_issue_224 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME stringNodeId_issue_224 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND stringNodeId_issue_224 ${CMAKE_CURRENT_SOURCE_DIR}/stringNodeId_issue_224.xml) add_executable(orderingStringNodeIds orderingStringNodeIds.c) target_include_directories(orderingStringNodeIds PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(orderingStringNodeIds PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(orderingStringNodeIds PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME orderingStringNodeIds WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND orderingStringNodeIds ${CMAKE_CURRENT_SOURCE_DIR}/orderingStringNodeIds.xml) add_executable(cornerCases cornerCases.c) target_include_directories(cornerCases PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(cornerCases PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(cornerCases PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME cornerCases_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND cornerCases ${CMAKE_CURRENT_SOURCE_DIR}/cornerCases.xml) add_executable(extension extension.c) target_include_directories(extension PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(extension PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(extension PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME extension_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND extension ${CMAKE_CURRENT_SOURCE_DIR}/extension.xml) add_executable(newHierachicalRef newHierachicalRef.c) target_include_directories(newHierachicalRef PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(newHierachicalRef PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(newHierachicalRef PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME newHierachicalRef_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND newHierachicalRef ${CMAKE_CURRENT_SOURCE_DIR}/newHierachicalRef.xml @@ -92,70 +92,70 @@ add_test(NAME newHierachicalRef_Test add_executable(references references.c) target_include_directories(references PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(references PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(references PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME references_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND references ${CMAKE_CURRENT_SOURCE_DIR}/references.xml) add_executable(multipleNamespaces multipleNamespaces.c) target_include_directories(multipleNamespaces PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(multipleNamespaces PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(multipleNamespaces PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME multipleNamespaces_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND multipleNamespaces ${CMAKE_CURRENT_SOURCE_DIR}/multipleNamespaces.xml) add_executable(structMultipleNamespaces structMultipleNamespaces.c) target_include_directories(structMultipleNamespaces PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(structMultipleNamespaces PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(structMultipleNamespaces PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME structMultipleNamespaces_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND structMultipleNamespaces ${CMAKE_CURRENT_SOURCE_DIR}/basestruct.xml ${CMAKE_CURRENT_SOURCE_DIR}/extendedstruct.xml) add_executable(structwitharray structwitharray.c) target_include_directories(structwitharray PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(structwitharray PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(structwitharray PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME structwitharray_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND structwitharray ${CMAKE_CURRENT_SOURCE_DIR}/structwitharray.xml) add_executable(nodeAttributes nodeAttributes.c) target_include_directories(nodeAttributes PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(nodeAttributes PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(nodeAttributes PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME nodeAttributes_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND nodeAttributes ${CMAKE_CURRENT_SOURCE_DIR}/nodeAttributes.xml) add_executable(primitiveValues primitiveValues.c) target_include_directories(primitiveValues PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(primitiveValues PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(primitiveValues PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME primitiveValues_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND primitiveValues ${CMAKE_CURRENT_SOURCE_DIR}/primitiveValues.xml) add_executable(conversion conversion.c) target_include_directories(conversion PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(conversion PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(conversion PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME conversion_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND conversion) add_executable(issue_246 issue_246.c) target_include_directories(issue_246 PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(issue_246 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(issue_246 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME issue_246_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND issue_246 ${CMAKE_CURRENT_SOURCE_DIR}/issue_246.xml) add_executable(issue_246_2 issue_246_2.c) target_include_directories(issue_246_2 PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(issue_246_2 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(issue_246_2 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME issue_246_2_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND issue_246_2 ${CMAKE_CURRENT_SOURCE_DIR}/issue_246_2.xml) add_executable(issue_266 issue_266_testdata.c) target_include_directories(issue_266 PRIVATE ${CHECK_INCLUDE_DIR}) -target_link_libraries(issue_266 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} Check::check ${PTHREAD_LIB}) +target_link_libraries(issue_266 PRIVATE NodesetLoader open62541::open62541 ${CHECK_LIBRARIES} ${CHECK_LIBRARIES} ${PTHREAD_LIB}) add_test(NAME issue_266_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND issue_266 ${CMAKE_CURRENT_SOURCE_DIR}/issue266_TestData.NodeSet2.xml) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a1d244e..ede4cee 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,7 +2,7 @@ add_executable(sort sort.c ${CMAKE_CURRENT_SOURCE_DIR}/../src/Sort.c ${CMAKE_CURRENT_SOURCE_DIR}/../src/nodes/InstanceNode.c) target_include_directories(sort PRIVATE ${CHECK_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_SOURCE_DIR}/../include) -target_link_libraries(sort PRIVATE Check::check ${PTHREAD_LIB} coverageLib open62541::open62541) +target_link_libraries(sort PRIVATE ${CHECK_LIBRARIES} ${PTHREAD_LIB} coverageLib open62541::open62541) add_test(NAME sort_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND sort ${CMAKE_CURRENT_LIST_DIR}) add_executable(nodeContainer @@ -13,21 +13,21 @@ add_executable(nodeContainer ${CMAKE_CURRENT_SOURCE_DIR}/../src/Value.c ) target_include_directories(nodeContainer PRIVATE ${CHECK_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../include ${CMAKE_CURRENT_SOURCE_DIR}/../src) -target_link_libraries(nodeContainer PRIVATE Check::check ${PTHREAD_LIB} coverageLib open62541::open62541) +target_link_libraries(nodeContainer PRIVATE ${CHECK_LIBRARIES} ${PTHREAD_LIB} coverageLib open62541::open62541) add_test(NAME nodeContainer_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND nodeContainer ${CMAKE_CURRENT_LIST_DIR}) add_executable(value ValueTest.c ${CMAKE_CURRENT_SOURCE_DIR}/../src/Value.c) target_include_directories(value PRIVATE ${CHECK_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../include) -target_link_libraries(value PRIVATE Check::check ${PTHREAD_LIB} coverageLib open62541::open62541) +target_link_libraries(value PRIVATE ${CHECK_LIBRARIES} ${PTHREAD_LIB} coverageLib open62541::open62541) add_test(NAME value_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND value ${CMAKE_CURRENT_LIST_DIR}) add_executable(allocator allocator.c ${CMAKE_CURRENT_SOURCE_DIR}/../src/CharAllocator.c) target_include_directories(allocator PRIVATE ${CHECK_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../src) -target_link_libraries(allocator PRIVATE Check::check ${PTHREAD_LIB} coverageLib open62541::open62541) +target_link_libraries(allocator PRIVATE ${CHECK_LIBRARIES} ${PTHREAD_LIB} coverageLib open62541::open62541) add_test(NAME allocatorTest WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND allocator ${CMAKE_CURRENT_LIST_DIR}) add_executable(parser parser.c) -target_link_libraries(parser PRIVATE NodesetLoader Check::check ${PTHREAD_LIB} coverageLib open62541::open62541) +target_link_libraries(parser PRIVATE NodesetLoader ${CHECK_LIBRARIES} ${PTHREAD_LIB} coverageLib open62541::open62541) target_include_directories(parser PRIVATE ${CHECK_INCLUDE_DIR}) add_test(NAME parser_Test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}