Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
set(CMAKE_FOLDER external)
list(APPEND CMAKE_MESSAGE_CONTEXT external)

if (${REPO_OPTION_PREFIX}_ENABLE_TESTS AND NOT TARGET gtest)
set(BUILD_GMOCK ON)
opendaq_module_setup_gtest(1.12.1)
endif()

add_subdirectory(PcapPlusPlus)
add_subdirectory(AsamCmpLib)
7 changes: 4 additions & 3 deletions modules/asam_cmp_capture_module/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ endif()
add_executable(${TEST_APP} ${TEST_SOURCES} ${TEST_HEADERS}
)

target_link_libraries(${TEST_APP} PRIVATE daq::opendaq
daq::test_utils
target_link_libraries(${TEST_APP} PRIVATE ${OPENDAQ_SDK_TARGET_NAMESPACE}::opendaq_test_utils
gtest
gmock
asam_cmp_capture_module_lib
)

Expand All @@ -38,6 +39,6 @@ add_test(NAME ${TEST_APP}

set_target_properties(${TEST_APP} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_APP}>)

if (OPENDAQ_ENABLE_COVERAGE)
if (COMMAND setup_target_for_coverage AND OPENDAQ_ENABLE_COVERAGE)
setup_target_for_coverage(${TEST_APP}coverage ${TEST_APP} ${TEST_APP}coverage)
endif()
19 changes: 6 additions & 13 deletions modules/asam_cmp_capture_module/tests/test_app.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
#include <opendaq/module_manager_factory.h>

#include <testutils/testutils.h>
#include <testutils/daq_memcheck_listener.h>
#include <coreobjects/util.h>
#include <opendaq/module_manager_init.h>
#include <asam_cmp_capture_module/common.h>
#include <asam_cmp_capture_module/module_dll.h>
#include <opendaq/context_factory.h>
#include <coretypes/stringobject_factory.h>
#include <opendaq/module_ptr.h>


int main(int argc, char** args)
{
using namespace daq;

daq::daqInitializeCoreObjectsTesting();
daqInitModuleManagerLibrary();
{
daq::ModuleManager(".");
}

testing::InitGoogleTest(&argc, args);

testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
listeners.Append(new DaqMemCheckListener());

auto res = RUN_ALL_TESTS();

return res;
return RUN_ALL_TESTS();
}
6 changes: 4 additions & 2 deletions modules/asam_cmp_data_sink/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ endif()
add_executable(${TEST_APP} ${TEST_SOURCES}
)

target_link_libraries(${TEST_APP} PRIVATE daq::test_utils
target_link_libraries(${TEST_APP} PRIVATE ${OPENDAQ_SDK_TARGET_NAMESPACE}::opendaq_test_utils
gtest
gmock
asam_cmp_data_sink_lib
)

Expand All @@ -28,6 +30,6 @@ add_test(NAME ${TEST_APP}

set_target_properties(${TEST_APP} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_APP}>)

if (OPENDAQ_ENABLE_COVERAGE)
if (COMMAND setup_target_for_coverage AND OPENDAQ_ENABLE_COVERAGE)
setup_target_for_coverage(${TEST_APP}coverage ${TEST_APP} ${TEST_APP}coverage)
endif()
19 changes: 8 additions & 11 deletions modules/asam_cmp_data_sink/tests/test_app.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#include <opendaq/module_manager_factory.h>

#include <EthLayer.h>
#include <Packet.h>
#include <coreobjects/util.h>
#include <opendaq/context_factory.h>
#include <opendaq/module_manager_init.h>
#include <testutils/daq_memcheck_listener.h>
#include <testutils/testutils.h>

#include <asam_cmp_data_sink/module_dll.h>
#include <testutils/testutils.h>
#include <testutils/daq_memcheck_listener.h>

int main(int argc, char** args)
{
using namespace daq;

daqInitializeCoreObjectsTesting();
daqInitModuleManagerLibrary();
{
daq::ModuleManager(".");
}

testing::InitGoogleTest(&argc, args);

Expand All @@ -25,7 +24,5 @@ int main(int argc, char** args)
testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
listeners.Append(new DaqMemCheckListener());

auto res = RUN_ALL_TESTS();

return res;
return RUN_ALL_TESTS();
}
1 change: 0 additions & 1 deletion shared/libraries/asam_cmp_common_lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ endif()
target_link_libraries(${PROJECT_NAME} PUBLIC daq::opendaq
Pcap++
asam_cmp
daq::test_utils
)

target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
Expand Down
6 changes: 4 additions & 2 deletions shared/libraries/asam_cmp_common_lib/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ set(TEST_SOURCES test_app.cpp
add_executable(${TEST_APP} ${TEST_SOURCES}
)

target_link_libraries(${TEST_APP} PRIVATE daq::test_utils
target_link_libraries(${TEST_APP} PRIVATE ${OPENDAQ_SDK_TARGET_NAMESPACE}::opendaq_test_utils
gtest
gmock
asam_cmp_data_sink
)

Expand All @@ -17,6 +19,6 @@ add_test(NAME ${TEST_APP}

set_target_properties(${TEST_APP} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY $<TARGET_FILE_DIR:${TEST_APP}>)

if (OPENDAQ_ENABLE_COVERAGE)
if (COMMAND setup_target_for_coverage AND OPENDAQ_ENABLE_COVERAGE)
setup_target_for_coverage(${TEST_APP}coverage ${TEST_APP} ${TEST_APP}coverage)
endif()
13 changes: 6 additions & 7 deletions shared/libraries/asam_cmp_common_lib/tests/test_app.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
#include <opendaq/module_manager_factory.h>

#include <testutils/testutils.h>
#include <testutils/daq_memcheck_listener.h>
#include <coreobjects/util.h>
#include <opendaq/module_manager_init.h>

int main(int argc, char** args)
{
using namespace daq;

daqInitializeCoreObjectsTesting();
daqInitModuleManagerLibrary();
{
daq::ModuleManager(".");
}

testing::InitGoogleTest(&argc, args);

testing::TestEventListeners& listeners = testing::UnitTest::GetInstance()->listeners();
listeners.Append(new DaqMemCheckListener());

auto res = RUN_ALL_TESTS();

return res;
return RUN_ALL_TESTS();
}