cabana: add test case for parsing all opendbc files (#30584)

* test opendbc files

* bump opendbc

* bump opendbc

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
pull/30601/head
Dean Lee 2 years ago committed by GitHub
parent 36ccbc8bbe
commit 33ee7530b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      tools/cabana/tests/test_cabana.cc

@ -1,5 +1,7 @@
#undef INFO
#include <QDir>
#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());
}

Loading…
Cancel
Save