You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 35a9502
Browse filesBrowse the repository at this point in the historyBrowse files
Removing the custom debug option for in favor of CMAKE_BUILD_TYPE arg. Added an option to enable the locale testing since it is platform specific and dependent
project(dbc VERSION 0.2.0 DESCRIPTION"C++ DBC Parser")
4
4
5
5
# -- PROJECT OPTIONS -- #
6
-
option(DEBUG"use debug flag"NO)
7
6
option(DBC_ENABLE_TESTS"Enable Unittests"ON)
7
+
option(DBC_TEST_LOCALE_INDEPENDENCE"Used to deterime if the libary is locale agnostic when it comes to converting floats. You need `de_DE.UTF-8` locale installed for this testing."OFF)
8
8
# Turn OFF, if you are using FetchContent to include it to your project
9
9
option(DBC_FETCH_CONTENT_INCLUSION"Include project with FetchContent_Declare in another project. In this case the headers and the cmake files are not needed, only the library"OFF)
10
10
option(DBC_GENERATE_DOCS"Use doxygen if installed to generated documentation files"OFF)
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,19 @@ from the python dbc library here: https://pypi.org/project/cantools/
7
7
## Building
8
8
9
9
I am using Cmake to be able to build the tests and the lib. I plan on doing more with it but this is what it
10
-
is for now. I am doing developement on the WSL Ubuntu 18.04 kernel. This doesn't mean that IDEs aren't
10
+
is for now. This doesn't mean that IDEs aren't
11
11
welcome but the build process might not be suited for this. You will need to modify it for your
12
12
needs. Feel free to submit changes so the building process will be more robust.
13
13
14
14
Here are the steps to get started:
15
15
```bash
16
+
# Release Build
16
17
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -H.
18
+
19
+
# Debug Build
20
+
cmake -DCMAKE_BUILD_TYPE=Debug -Bbuild -H.
21
+
22
+
# Run the build
17
23
cmake --build build
18
24
```
19
25
@@ -35,6 +41,10 @@ cmake -LAH ..
35
41
I am trying to always make sure that this is very well tested code. I am using Catch2 to do this
36
42
testing and if you aren't familiar here is the documentation: https://github.com/catchorg/Catch2/blob/master/docs/Readme.md#top
37
43
44
+
There is one option you will want for testing: `DBC_TEST_LOCALE_INDEPENDENCE`. This requires the `de_DE.UTF-8` locale installed to test. It is for checking we don't rely on locale to convert floats. i.e. 1.23 vs 1,23
45
+
46
+
You will need to configure the project to enable this: `cmake -DCMAKE_BUILD_TYPE=Release -DDBC_TEST_LOCALE_INDEPENDENCE=ON -Bbuild -H.`. You will get a warning if it isn't enabled because it isn't enabled by default.
47
+
38
48
To run the tests locally you can use the following. Assuming you have built the project you should get a test executable.
0 commit comments