Precommit (#1)

* first commit

* cleanup
This commit is contained in:
tompzf
2025-11-04 13:28:06 +01:00
committed by GitHub
parent dba45dc636
commit 6ed4b1534e
898 changed files with 256340 additions and 0 deletions

View 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)

File diff suppressed because it is too large Load Diff

View 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

View 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();
}