Commit 698b739b authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #158 from jjhall89/unitTestFix

Unit test fix
parents bd4c4e9d 6f060047
...@@ -54,7 +54,7 @@ MOC_DIR = $${BUILDDIR}/moc ...@@ -54,7 +54,7 @@ MOC_DIR = $${BUILDDIR}/moc
UI_DIR = $${BUILDDIR}/ui UI_DIR = $${BUILDDIR}/ui
RCC_DIR = $${BUILDDIR}/rcc RCC_DIR = $${BUILDDIR}/rcc
MAVLINK_CONF = "" MAVLINK_CONF = ""
MAVLINKPATH = $$BASEDIR/mavlink/include/v1.0 MAVLINKPATH = $$BASEDIR/libs/mavlink/include/mavlink/v1.0
DEFINES += MAVLINK_NO_DATA DEFINES += MAVLINK_NO_DATA
win32 { win32 {
...@@ -64,6 +64,13 @@ win32 { ...@@ -64,6 +64,13 @@ win32 {
QMAKE_MOC = "$$(QTDIR)/bin/moc.exe" QMAKE_MOC = "$$(QTDIR)/bin/moc.exe"
QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe" QMAKE_RCC = "$$(QTDIR)/bin/rcc.exe"
QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe" QMAKE_QMAKE = "$$(QTDIR)/bin/qmake.exe"
# Build QAX for GoogleEarth API access
!exists( $(QTDIR)/src/activeqt/Makefile ) {
message( Making QAx (ONE TIME) )
system( cd $$(QTDIR)\\src\\activeqt && $$(QTDIR)\\bin\\qmake.exe )
system( cd $$(QTDIR)\\src\\activeqt\\container && $$(QTDIR)\\bin\\qmake.exe )
system( cd $$(QTDIR)\\src\\activeqt\\control && $$(QTDIR)\\bin\\qmake.exe )
}
} }
...@@ -72,22 +79,22 @@ win32 { ...@@ -72,22 +79,22 @@ win32 {
# EXTERNAL LIBRARY CONFIGURATION # EXTERNAL LIBRARY CONFIGURATION
# EIGEN matrix library (header-only) # EIGEN matrix library (header-only)
INCLUDEPATH += src/libs/eigen INCLUDEPATH += libs/eigen
# OPMapControl library (from OpenPilot) # OPMapControl library (from OpenPilot)
include(src/libs/utils/utils_external.pri) include(libs/utils/utils_external.pri)
include(src/libs/opmapcontrol/opmapcontrol_external.pri) include(libs/opmapcontrol/opmapcontrol_external.pri)
DEPENDPATH += \ DEPENDPATH += \
src/libs/utils \ libs/utils \
src/libs/utils/src \ libs/utils/src \
src/libs/opmapcontrol \ libs/opmapcontrol \
src/libs/opmapcontrol/src \ libs/opmapcontrol/src \
src/libs/opmapcontrol/src/mapwidget libs/opmapcontrol/src/mapwidget
INCLUDEPATH += \ INCLUDEPATH += \
src/libs/utils \ libs/utils \
src/libs \ libs \
src/libs/opmapcontrol libs/opmapcontrol
# If the user config file exists, it will be included. # If the user config file exists, it will be included.
# if the variable MAVLINK_CONF contains the name of an # if the variable MAVLINK_CONF contains the name of an
...@@ -99,50 +106,13 @@ exists(user_config.pri) { ...@@ -99,50 +106,13 @@ exists(user_config.pri) {
message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF) message("Adding support for additional MAVLink messages for: " $$MAVLINK_CONF)
message("------------------------------------------------------------------------") message("------------------------------------------------------------------------")
} }
INCLUDEPATH += $$MAVLINKPATH/common
INCLUDEPATH += $$MAVLINKPATH INCLUDEPATH += $$MAVLINKPATH
contains(MAVLINK_CONF, pixhawk) { isEmpty(MAVLINK_CONF) {
# Remove the default set - it is included anyway INCLUDEPATH += $$MAVLINKPATH/common
INCLUDEPATH -= $$MAVLINKPATH/common } else {
INCLUDEPATH += $$MAVLINKPATH/$$MAVLINK_CONF
# PIXHAWK SPECIAL MESSAGES #DEFINES += 'MAVLINK_CONF="$${MAVLINK_CONF}.h"'
INCLUDEPATH += $$MAVLINKPATH/pixhawk DEFINES += $$sprintf('QGC_USE_%1_MESSAGES', $$upper($$MAVLINK_CONF))
DEFINES += QGC_USE_PIXHAWK_MESSAGES
}
contains(MAVLINK_CONF, slugs) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$MAVLINKPATH/common
# SLUGS SPECIAL MESSAGES
INCLUDEPATH += $$MAVLINKPATH/slugs
DEFINES += QGC_USE_SLUGS_MESSAGES
SOURCES += $$TESTDIR/SlugsMavUnitTest.cc
HEADERS += $$TESTDIR/SlugsMavUnitTest.h
}
contains(MAVLINK_CONF, ualberta) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$MAVLINKPATH/common
# UALBERTA SPECIAL MESSAGES
INCLUDEPATH += $$MAVLINKPATH/ualberta
DEFINES += QGC_USE_UALBERTA_MESSAGES
}
contains(MAVLINK_CONF, ardupilotmega) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$MAVLINKPATH/common
# UALBERTA SPECIAL MESSAGES
INCLUDEPATH += $$MAVLINKPATH/ardupilotmega
DEFINES += QGC_USE_ARDUPILOTMEGA_MESSAGES
}
contains(MAVLINK_CONF, senseSoar) {
# Remove the default set - it is included anyway
INCLUDEPATH -= $$MAVLINKPATH/common
# SENSESOAR SPECIAL MESSAGES
INCLUDEPATH += $$MAVLINKPATH/SenseSoar
DEFINES += QGC_USE_SENSESOAR_MESSAGES
} }
# Include general settings for QGroundControl # Include general settings for QGroundControl
...@@ -167,29 +137,29 @@ include(src/apps/mavlinkgen/mavlinkgen.pri) ...@@ -167,29 +137,29 @@ include(src/apps/mavlinkgen/mavlinkgen.pri)
# Include QWT plotting library # Include QWT plotting library
include(src/lib/qwt/qwt.pri) include(libs/qwt/qwt.pri)
DEPENDPATH += . \ DEPENDPATH += . \
plugins \ plugins \
thirdParty/qserialport/include \ libs/thirdParty/qserialport/include \
thirdParty/qserialport/include/QtSerialPort \ libs/thirdParty/qserialport/include/QtSerialPort \
thirdParty/qserialport \ libs/thirdParty/qserialport \
src/libs/qextserialport libs/qextserialport
INCLUDEPATH += . \ INCLUDEPATH += . \
thirdParty/qserialport/include \ libs/thirdParty/qserialport/include \
thirdParty/qserialport/include/QtSerialPort \ libs/thirdParty/qserialport/include/QtSerialPort \
thirdParty/qserialport/src \ libs/thirdParty/qserialport/src \
src/libs/qextserialport libs/qextserialport
# Include serial port library (QSerial) # Include serial port library (QSerial)
include(qserialport.pri) include(qserialport.pri)
# Serial port detection (ripped-off from qextserialport library) # Serial port detection (ripped-off from qextserialport library)
macx|macx-g++|macx-g++42::SOURCES += src/libs/qextserialport/qextserialenumerator_osx.cpp macx|macx-g++|macx-g++42::SOURCES += libs/qextserialport/qextserialenumerator_osx.cpp
linux-g++::SOURCES += src/libs/qextserialport/qextserialenumerator_unix.cpp linux-g++::SOURCES += libs/qextserialport/qextserialenumerator_unix.cpp
linux-g++-64::SOURCES += src/libs/qextserialport/qextserialenumerator_unix.cpp linux-g++-64::SOURCES += libs/qextserialport/qextserialenumerator_unix.cpp
win32::SOURCES += src/libs/qextserialport/qextserialenumerator_win.cpp win32::SOURCES += libs/qextserialport/qextserialenumerator_win.cpp
win32-msvc2008|win32-msvc2010::SOURCES += src/libs/qextserialport/qextserialenumerator_win.cpp win32-msvc2008|win32-msvc2010::SOURCES += libs/qextserialport/qextserialenumerator_win.cpp
# Input # Input
FORMS += src/ui/MainWindow.ui \ FORMS += src/ui/MainWindow.ui \
...@@ -234,16 +204,6 @@ FORMS += src/ui/MainWindow.ui \ ...@@ -234,16 +204,6 @@ FORMS += src/ui/MainWindow.ui \
src/ui/UASControlParameters.ui \ src/ui/UASControlParameters.ui \
src/ui/map/QGCMapTool.ui \ src/ui/map/QGCMapTool.ui \
src/ui/map/QGCMapToolBar.ui \ src/ui/map/QGCMapToolBar.ui \
src/ui/mission/QGCMissionOther.ui \
src/ui/mission/QGCMissionConditionDelay.ui \
src/ui/mission/QGCMissionDoJump.ui \
src/ui/mission/QGCMissionNavReturnToLaunch.ui \
src/ui/mission/QGCMissionNavLoiterUnlim.ui \
src/ui/mission/QGCMissionNavLoiterTurns.ui \
src/ui/mission/QGCMissionNavTakeoff.ui \
src/ui/mission/QGCMissionNavLand.ui \
src/ui/mission/QGCMissionNavWaypoint.ui \
src/ui/mission/QGCMissionNavLoiterTime.ui \
src/ui/QGCMAVLinkInspector.ui \ src/ui/QGCMAVLinkInspector.ui \
src/ui/WaypointViewOnlyView.ui \ src/ui/WaypointViewOnlyView.ui \
src/ui/WaypointEditableView.ui \ src/ui/WaypointEditableView.ui \
...@@ -251,7 +211,17 @@ FORMS += src/ui/MainWindow.ui \ ...@@ -251,7 +211,17 @@ FORMS += src/ui/MainWindow.ui \
src/ui/mavlink/QGCMAVLinkMessageSender.ui \ src/ui/mavlink/QGCMAVLinkMessageSender.ui \
src/ui/firmwareupdate/QGCFirmwareUpdateWidget.ui \ src/ui/firmwareupdate/QGCFirmwareUpdateWidget.ui \
src/ui/QGCPluginHost.ui \ src/ui/QGCPluginHost.ui \
src/ui/firmwareupdate/QGCPX4FirmwareUpdate.ui src/ui/firmwareupdate/QGCPX4FirmwareUpdate.ui \
src/ui/mission/QGCMissionOther.ui \
src/ui/mission/QGCMissionNavWaypoint.ui \
src/ui/mission/QGCMissionDoJump.ui \
src/ui/mission/QGCMissionConditionDelay.ui \
src/ui/mission/QGCMissionNavLoiterUnlim.ui \
src/ui/mission/QGCMissionNavLoiterTurns.ui \
src/ui/mission/QGCMissionNavLoiterTime.ui \
src/ui/mission/QGCMissionNavReturnToLaunch.ui \
src/ui/mission/QGCMissionNavLand.ui \
src/ui/mission/QGCMissionNavTakeoff.ui \
INCLUDEPATH += src \ INCLUDEPATH += src \
src/ui \ src/ui \
...@@ -260,12 +230,15 @@ INCLUDEPATH += src \ ...@@ -260,12 +230,15 @@ INCLUDEPATH += src \
src/ui/map \ src/ui/map \
src/uas \ src/uas \
src/comm \ src/comm \
include/ui \
src/input \ src/input \
src/lib/qmapcontrol \
src/ui/mavlink \ src/ui/mavlink \
src/ui/param \
src/ui/watchdog \ src/ui/watchdog \
src/ui/map3D \ src/ui/map3D \
src/ui/mission \
src/ui/designer src/ui/designer
HEADERS += src/MG.h \ HEADERS += src/MG.h \
src/QGCCore.h \ src/QGCCore.h \
src/uas/UASInterface.h \ src/uas/UASInterface.h \
...@@ -368,7 +341,7 @@ HEADERS += src/MG.h \ ...@@ -368,7 +341,7 @@ HEADERS += src/MG.h \
src/ui/mission/QGCMissionNavLand.h \ src/ui/mission/QGCMissionNavLand.h \
src/ui/mission/QGCMissionNavWaypoint.h \ src/ui/mission/QGCMissionNavWaypoint.h \
src/ui/mission/QGCMissionNavLoiterTime.h \ src/ui/mission/QGCMissionNavLoiterTime.h \
src/libs/qextserialport/qextserialenumerator.h \ libs/qextserialport/qextserialenumerator.h \
src/QGCGeo.h \ src/QGCGeo.h \
src/ui/QGCToolBar.h \ src/ui/QGCToolBar.h \
src/ui/QGCMAVLinkInspector.h \ src/ui/QGCMAVLinkInspector.h \
...@@ -382,6 +355,16 @@ HEADERS += src/MG.h \ ...@@ -382,6 +355,16 @@ HEADERS += src/MG.h \
src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \ src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \
src/ui/QGCPluginHost.h \ src/ui/QGCPluginHost.h \
src/ui/firmwareupdate/QGCPX4FirmwareUpdate.h \ src/ui/firmwareupdate/QGCPX4FirmwareUpdate.h \
src/ui/mission/QGCMissionOther.h \
src/ui/mission/QGCMissionNavWaypoint.h \
src/ui/mission/QGCMissionDoJump.h \
src/ui/mission/QGCMissionConditionDelay.h \
src/ui/mission/QGCMissionNavLoiterUnlim.h \
src/ui/mission/QGCMissionNavLoiterTurns.h \
src/ui/mission/QGCMissionNavLoiterTime.h \
src/ui/mission/QGCMissionNavReturnToLaunch.h \
src/ui/mission/QGCMissionNavLand.h \
src/ui/mission/QGCMissionNavTakeoff.h \
$$TESTDIR/AutoTest.h \ $$TESTDIR/AutoTest.h \
$$TESTDIR/UASUnitTest.h \ $$TESTDIR/UASUnitTest.h \
...@@ -419,7 +402,7 @@ contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) { ...@@ -419,7 +402,7 @@ contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) {
message("Including headers for Protocol Buffers") message("Including headers for Protocol Buffers")
# Enable only if protobuf is available # Enable only if protobuf is available
HEADERS += mavlink/include/v1.0/pixhawk/pixhawk.pb.h \ HEADERS += libs/mavlink/include/v1.0/pixhawk/pixhawk.pb.h \
src/ui/map3D/ObstacleGroupNode.h \ src/ui/map3D/ObstacleGroupNode.h \
src/ui/map3D/GLOverlayGeode.h src/ui/map3D/GLOverlayGeode.h
} }
...@@ -581,7 +564,7 @@ contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) { ...@@ -581,7 +564,7 @@ contains(DEPENDENCIES_PRESENT, protobuf):contains(MAVLINK_CONF, pixhawk) {
message("Including sources for Protocol Buffers") message("Including sources for Protocol Buffers")
# Enable only if protobuf is available # Enable only if protobuf is available
SOURCES += mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \ SOURCES += libs/mavlink/share/mavlink/src/v1.0/pixhawk/pixhawk.pb.cc \
src/ui/map3D/ObstacleGroupNode.cc \ src/ui/map3D/ObstacleGroupNode.cc \
src/ui/map3D/GLOverlayGeode.cc src/ui/map3D/GLOverlayGeode.cc
} }
...@@ -631,8 +614,8 @@ win32-msvc2008|win32-msvc2010|linux { ...@@ -631,8 +614,8 @@ win32-msvc2008|win32-msvc2010|linux {
src/comm/HexSpinBox.cpp \ src/comm/HexSpinBox.cpp \
src/ui/XbeeConfigurationWindow.cpp src/ui/XbeeConfigurationWindow.cpp
DEFINES += XBEELINK DEFINES += XBEELINK
INCLUDEPATH += thirdParty/libxbee INCLUDEPATH += libs/thirdParty/libxbee
# TO DO: build library when it does not exist already # TO DO: build library when it does not exist already
LIBS += -LthirdParty/libxbee/lib \ LIBS += -Llibs/thirdParty/libxbee/lib \
-llibxbee -llibxbee
} }
...@@ -89,6 +89,7 @@ void UASUnitTest::setAutopilotType_test() ...@@ -89,6 +89,7 @@ void UASUnitTest::setAutopilotType_test()
QCOMPARE(uas->getAutopilotType(), 2); QCOMPARE(uas->getAutopilotType(), 2);
} }
//verify that the correct status is returned if a certain statue is given to uas
void UASUnitTest::getStatusForCode_test() void UASUnitTest::getStatusForCode_test()
{ {
QString state, desc; QString state, desc;
...@@ -347,6 +348,8 @@ void UASUnitTest::signalUASLink_test() ...@@ -347,6 +348,8 @@ void UASUnitTest::signalUASLink_test()
QCOMPARE(spyS.count(), 3); QCOMPARE(spyS.count(), 3);
QCOMPARE(LinkManager::instance()->getLinks().count(), 2); QCOMPARE(LinkManager::instance()->getLinks().count(), 2);
//all the links in LinkManager must be deleted because LinkManager::instance
//is static.
LinkManager::instance()->removeLink(link3); LinkManager::instance()->removeLink(link3);
delete link3; delete link3;
QCOMPARE(LinkManager::instance()->getLinks().count(), 1); QCOMPARE(LinkManager::instance()->getLinks().count(), 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment