mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-07-02 05:35:11 +00:00
21
tests/unit_tests/dbc_parser/CMakeLists.txt
Normal file
21
tests/unit_tests/dbc_parser/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# Define project
|
||||
project (UnitTest_DBC_Parser VERSION 1.0 LANGUAGES CXX)
|
||||
|
||||
# Compile the source code
|
||||
add_executable(UnitTest_DBC_Parser
|
||||
"dbc_parser_test.cpp"
|
||||
"dbc_parser_test.h"
|
||||
"main.cpp")
|
||||
target_link_libraries(UnitTest_DBC_Parser ${CMAKE_DL_LIBS} GTest::GTest)
|
||||
|
||||
# Add the IDL Compiler unittest
|
||||
add_test(NAME UnitTest_DBC_Parser COMMAND UnitTest_DBC_Parser)
|
||||
|
||||
# Execute the test
|
||||
add_custom_command(TARGET UnitTest_DBC_Parser POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E env TEST_EXECUTION_MODE=CMake "$<TARGET_FILE:UnitTest_DBC_Parser>" --gtest_output=xml:${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/UnitTest_DBC_Parser.xml
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# The unit-test project depends on a proper compilation of the compiler before
|
||||
add_dependencies(UnitTest_DBC_Parser dependency_sdv_components)
|
||||
2128
tests/unit_tests/dbc_parser/dbc_parser_test.cpp
Normal file
2128
tests/unit_tests/dbc_parser/dbc_parser_test.cpp
Normal file
File diff suppressed because it is too large
Load Diff
39
tests/unit_tests/dbc_parser/dbc_parser_test.h
Normal file
39
tests/unit_tests/dbc_parser/dbc_parser_test.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef COMMANDLINE_PARSER_TEST_H
|
||||
#define COMMANDLINE_PARSER_TEST_H
|
||||
|
||||
#include <support/mem_access.h>
|
||||
#include <support/interface_ptr.h>
|
||||
|
||||
/**
|
||||
* \brief Test class for instantiation tests.
|
||||
*/
|
||||
class CDbcParserTest : public testing::Test
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \brief Constructor
|
||||
*/
|
||||
CDbcParserTest() = default;
|
||||
|
||||
/**
|
||||
* \brief Set up the test suite.
|
||||
*/
|
||||
static void SetUpTestCase();
|
||||
|
||||
/**
|
||||
* \brief Tear down the test suite.
|
||||
*/
|
||||
static void TearDownTestCase();
|
||||
|
||||
/**
|
||||
* \brief Test setup.
|
||||
*/
|
||||
void SetUp() override;
|
||||
|
||||
/**
|
||||
* \brief Test teardown.
|
||||
*/
|
||||
void TearDown() override;
|
||||
};
|
||||
|
||||
#endif // !defined COMMANDLINE_PARSER_TEST_H
|
||||
19
tests/unit_tests/dbc_parser/main.cpp
Normal file
19
tests/unit_tests/dbc_parser/main.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include "../../../global/process_watchdog.h"
|
||||
#include "../../../global/localmemmgr.h"
|
||||
|
||||
/**
|
||||
* @brief Main function
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_UNICODE)
|
||||
extern "C" int wmain(int argc, wchar_t* argv[])
|
||||
#else
|
||||
extern "C" int main(int argc, char* argv[])
|
||||
#endif
|
||||
{
|
||||
CProcessWatchdog watchdog;
|
||||
|
||||
CLocalMemMgr memmgr;
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
Reference in New Issue
Block a user