From 33ee7530b39bf01051c11cb888695b0962c92f95 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 5 Dec 2023 09:12:22 +0800 Subject: [PATCH] cabana: add test case for parsing all opendbc files (#30584) * test opendbc files * bump opendbc * bump opendbc --------- Co-authored-by: Shane Smiskol --- tools/cabana/tests/test_cabana.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/cabana/tests/test_cabana.cc b/tools/cabana/tests/test_cabana.cc index f6884a2dc9..c7dc91e7aa 100644 --- a/tools/cabana/tests/test_cabana.cc +++ b/tools/cabana/tests/test_cabana.cc @@ -1,5 +1,7 @@ #undef INFO +#include + #include "catch2/catch.hpp" #include "tools/replay/logreader.h" #include "tools/cabana/dbc/dbcmanager.h" @@ -85,3 +87,17 @@ CM_ SG_ 160 signal_2 "multiple line comment REQUIRE(msg->sigs[1]->size == 1); REQUIRE(msg->sigs[1]->receiver_name == "XXX"); } + +TEST_CASE("parse_opendbc") { + QDir dir(OPENDBC_FILE_PATH); + QStringList errors; + for (auto fn : dir.entryList({"*.dbc"}, QDir::Files, QDir::Name)) { + try { + auto dbc = DBCFile(dir.filePath(fn)); + } catch (std::exception &e) { + errors.push_back(e.what()); + } + } + INFO(errors.join("\n").toStdString()); + REQUIRE(errors.empty()); +}