add main for tests
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
#include <QtTest>
|
||||||
|
|
||||||
|
#include "tst_lfqueue.h"
|
||||||
|
#include "tst_cancon.h"
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
|
int status = 0;
|
||||||
|
auto ASSERT_TEST = [&status, argc, argv](QObject* obj) {
|
||||||
|
status |= QTest::qExec(obj, argc, argv);
|
||||||
|
delete obj;
|
||||||
|
};
|
||||||
|
|
||||||
|
ASSERT_TEST(new TestLFQueue());
|
||||||
|
ASSERT_TEST(new TestCanCon(CANCon::SOCKETCAN, "vcan0", 1));
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|||||||
+21
-4
@@ -1,12 +1,19 @@
|
|||||||
QT += widgets testlib
|
QT += core gui serialbus widgets testlib serialbus
|
||||||
QT -= gui
|
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
INCLUDEPATH += ../utils
|
INCLUDEPATH += ../ ../connections
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
tst_lfqueue.cpp
|
tst_lfqueue.cpp \
|
||||||
|
main.cpp \
|
||||||
|
tst_cancon.cpp \
|
||||||
|
../connections/canconfactory.cpp \
|
||||||
|
../connections/canconnection.cpp \
|
||||||
|
../connections/gvretserial.cpp \
|
||||||
|
../connections/socketcan.cpp \
|
||||||
|
../canbus.cpp
|
||||||
|
|
||||||
|
|
||||||
#HEADERS += \
|
#HEADERS += \
|
||||||
@@ -14,3 +21,13 @@ SOURCES += \
|
|||||||
|
|
||||||
target.path= .
|
target.path= .
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
tst_lfqueue.h \
|
||||||
|
tst_cancon.h \
|
||||||
|
../connections/canconconst.h \
|
||||||
|
../connections/canconfactory.h \
|
||||||
|
../connections/canconnection.h \
|
||||||
|
../connections/gvretserial.h \
|
||||||
|
../connections/socketcan.h \
|
||||||
|
../canbus.h
|
||||||
|
|||||||
Reference in New Issue
Block a user