Files
sunnypilot/selfdrive/ui/tests/test_runner.cc
Shane Smiskol 66ec788005 Test all of selfdrive/ (#33575)
* test selfdrived!

* exit() is for interactive sessions

* fix

* comments

* more

* test all of selfdrive/

* ignore what we used to

* fix test_alerts

* fix test_alertmanager.py
2024-10-03 23:39:13 -07:00

27 lines
748 B
C++

#define CATCH_CONFIG_RUNNER
#include "catch2/catch.hpp"
#include <QApplication>
#include <QDebug>
#include <QDir>
#include <QTranslator>
int main(int argc, char **argv) {
// unit tests for Qt
QApplication app(argc, argv);
QString language_file = "main_test_en";
// FIXME: pytest-cpp considers this print as a test case
qDebug() << "Loading language:" << language_file;
QTranslator translator;
QString translationsPath = QDir::cleanPath(qApp->applicationDirPath() + "/../translations");
if (!translator.load(language_file, translationsPath)) {
qDebug() << "Failed to load translation file!";
}
app.installTranslator(&translator);
const int res = Catch::Session().run(argc, argv);
return (res < 0xff ? res : 0xff);
}