Skip to content

Commit 490069f

Browse files
committed
Refactored the common and defines to a testing_utils folder
1 parent b3d5c83 commit 490069f

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ add_executable(dbcParserTests
2929
test_dbc.cpp
3030
test_utils.cpp
3131
test_parse_message.cpp
32-
common.cpp
32+
testing_utils/common.cpp
3333
)
3434

3535
target_compile_definitions(dbcParserTests PRIVATE TESTDBCFILES_PATH="${CMAKE_CURRENT_SOURCE_DIR}/dbcs")
@@ -43,7 +43,7 @@ catch_discover_tests(dbcParserTests)
4343
if(DBC_TEST_LOCALE_INDEPENDENCE)
4444
add_executable(dbcLocaleTests
4545
locale_testing/test_locale_main.cpp
46-
common.cpp
46+
testing_utils/common.cpp
4747
)
4848

4949
target_compile_definitions(dbcLocaleTests PRIVATE TESTDBCFILES_PATH="${CMAKE_CURRENT_SOURCE_DIR}/dbcs")
@@ -60,7 +60,7 @@ endif()
6060
if(DBC_GENERATE_SINGLE_HEADER)
6161
add_executable(dbcSingleHeaderTest
6262
single_header_testing/test_single_header.cpp
63-
common.cpp
63+
testing_utils/common.cpp
6464
)
6565

6666
target_compile_definitions(dbcSingleHeaderTest PRIVATE TESTDBCFILES_PATH="${CMAKE_CURRENT_SOURCE_DIR}/dbcs")

test/locale_testing/test_locale_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "common.hpp"
2-
#include "defines.hpp"
1+
#include "testing_utils/common.hpp"
2+
#include "testing_utils/defines.hpp"
33
#include <libdbc/dbc.hpp>
44
#include <libdbc/utils/utils.hpp>
55

test/single_header_testing/test_single_header.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "common.hpp"
2-
#include "defines.hpp"
1+
#include "testing_utils/common.hpp"
2+
#include "testing_utils/defines.hpp"
33
#include <libdbc/libdbc.hpp>
44

55
#include <catch2/catch_approx.hpp>

test/test_dbc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "common.hpp"
2-
#include "defines.hpp"
1+
#include "testing_utils/common.hpp"
2+
#include "testing_utils/defines.hpp"
33
#include <catch2/catch_approx.hpp>
44
#include <catch2/catch_test_macros.hpp>
55
#include <catch2/matchers/catch_matchers.hpp>

test/test_parse_message.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#include <libdbc/dbc.hpp>
66

7-
#include "common.hpp"
8-
#include "defines.hpp"
7+
#include "testing_utils/common.hpp"
8+
#include "testing_utils/defines.hpp"
99

1010
// Testing of parsing messages
1111

test/test_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "defines.hpp"
1+
#include "testing_utils/defines.hpp"
22
#include <catch2/catch_test_macros.hpp>
33
#include <libdbc/utils/utils.hpp>
44

test/common.cpp renamed to test/testing_utils/common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "common.hpp"
2-
#include "defines.hpp"
1+
#include "testing_utils/common.hpp"
2+
#include "testing_utils/defines.hpp"
33
#include <chrono>
44
#include <filesystem>
55
#include <fstream>
File renamed without changes.
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
#include <string>
2-
3-
// Correctly formated files
4-
static const std::string COMPLEX_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/Complex.dbc";
5-
static const std::string SIMPLE_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/Simple.dbc";
6-
7-
// Files with Errors
8-
static const std::string MISSING_NEW_SYMBOLS_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/MissingNewSymbols.dbc";
9-
static const std::string MISSING_VERSION_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/MissingVersion.dbc";
10-
static const std::string MISSING_BIT_TIMING_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/MissingBitTiming.dbc";
11-
static const std::string TEXT_FILE = std::string(TESTDBCFILES_PATH) + "/TextFile.txt";
12-
13-
static const std::string PRIMITIVE_DBC =
14-
R"(VERSION "1.0.0"
15-
16-
NS_ :
17-
18-
BS_:
19-
20-
BU_: DBG DRIVER IO MOTOR SENSOR
21-
22-
)";
1+
#include <string>
2+
3+
// Correctly formated files
4+
static const std::string COMPLEX_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/Complex.dbc";
5+
static const std::string SIMPLE_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/Simple.dbc";
6+
7+
// Files with Errors
8+
static const std::string MISSING_NEW_SYMBOLS_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/MissingNewSymbols.dbc";
9+
static const std::string MISSING_VERSION_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/MissingVersion.dbc";
10+
static const std::string MISSING_BIT_TIMING_DBC_FILE = std::string(TESTDBCFILES_PATH) + "/MissingBitTiming.dbc";
11+
static const std::string TEXT_FILE = std::string(TESTDBCFILES_PATH) + "/TextFile.txt";
12+
13+
static const std::string PRIMITIVE_DBC =
14+
R"(VERSION "1.0.0"
15+
16+
NS_ :
17+
18+
BS_:
19+
20+
BU_: DBG DRIVER IO MOTOR SENSOR
21+
22+
)";

0 commit comments

Comments
 (0)