File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 3.12)
33
44project ("libdbcppp" VERSION 0.1.0)
55
6+ option (build_tests "Build tests" ON )
7+ option (build_examples "Build examples" ON )
8+
69set (CMAKE_CXX_STANDARD 17)
710set (CMAKE_STATIC_LIBRARY_PREFIX "" )
811set (CMAKE_SHARED_LIBRARY_PREFIX "" )
@@ -50,8 +53,12 @@ install(
5053 FILES_MATCHING PATTERN "*.h" )
5154
5255add_subdirectory (src )
53- add_subdirectory (tests )
54- add_subdirectory (examples )
56+ if (build_tests)
57+ add_subdirectory (tests )
58+ endif ()
59+ if (build_examples)
60+ add_subdirectory (examples )
61+ endif ()
5562
5663set (CMAKE_STATIC_LIBRARY_PREFIX "" )
5764set (CMAKE_SHARED_LIBRARY_PREFIX "" )
Original file line number Diff line number Diff line change 44
55#include " ../../include/dbcppp/CApi.h"
66#include " ../../include/dbcppp/Network.h"
7- #include " ../../tests/Config.h"
87
98// from uapi/linux/can.h
109using canid_t = uint32_t ;
@@ -53,7 +52,7 @@ int main()
5352{
5453 std::unique_ptr<dbcppp::INetwork> net;
5554 {
56- std::ifstream idbc (TEST_DBC );
55+ std::ifstream idbc (" your.dbc " );
5756 net = dbcppp::INetwork::LoadDBCFromIs (idbc);
5857 }
5958 std::unordered_map<uint64_t , const dbcppp::IMessage*> messages;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ TEST_CASE("DBCParserTest", "[]")
2020 {
2121 continue ;
2222 }
23- std::cout << " Testing DBC grammar with file: " << dbc_file << std::endl;
23+ std::cout << " Testing DBC grammar with file: " << dbc_file. path () << std::endl;
2424 auto dbc_file_tmp = dbc_file.path ().string () + " .tmp" ;
2525 std::unique_ptr<dbcppp::INetwork> spec;
2626 std::unique_ptr<dbcppp::INetwork> test;
You can’t perform that action at this time.
0 commit comments