Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6e11fae8
Commit
6e11fae8
authored
May 14, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-enable a subset of unittesting
parent
6331f7bc
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
141 additions
and
33 deletions
+141
-33
qgroundcontrol.pro
qgroundcontrol.pro
+98
-3
AirMapFlightManager.h
src/Airmap/AirMapFlightManager.h
+0
-2
RadioComponentController.h
src/AutoPilotPlugins/Common/RadioComponentController.h
+1
-1
FactSystemTestBase.cc
src/FactSystem/FactSystemTestBase.cc
+6
-1
JoystickConfigController.h
src/VehicleSetup/JoystickConfigController.h
+1
-1
main.cc
src/main.cc
+1
-1
MavlinkLogTest.cc
src/qgcunittest/MavlinkLogTest.cc
+0
-1
UnitTest.cc
src/qgcunittest/UnitTest.cc
+21
-10
UnitTestList.cc
src/qgcunittest/UnitTestList.cc
+13
-13
No files found.
qgroundcontrol.pro
View file @
6e11fae8
...
...
@@ -330,7 +330,7 @@ equals(QT_MAJOR_VERSION, 5):equals(QT_MINOR_VERSION, 9):AndroidBuild {
DebugBuild
{
#
Unit
Test
resources
#--
TODO
:
RESOURCES
+=
UnitTest
.
qrc
RESOURCES
+=
UnitTest
.
qrc
}
DEPENDPATH
+=
\
...
...
@@ -395,6 +395,103 @@ SOURCES += \
src
/
api
/
QmlComponentInfo
.
cc
\
src
/
comm
/
MavlinkMessagesTimer
.
cc
#
#
Unit
Test
specific
configuration
goes
here
(
requires
full
debug
build
with
all
plugins
)
#
DebugBuild
{
PX4FirmwarePlugin
{
PX4FirmwarePluginFactory
{
APMFirmwarePlugin
{
APMFirmwarePluginFactory
{
!
MobileBuild
{
DEFINES
+=
UNITTEST_BUILD
INCLUDEPATH
+=
\
src
/
qgcunittest
HEADERS
+=
\
src
/
Audio
/
AudioOutputTest
.
h
\
src
/
FactSystem
/
FactSystemTestBase
.
h
\
src
/
FactSystem
/
FactSystemTestGeneric
.
h
\
src
/
FactSystem
/
FactSystemTestPX4
.
h
\
src
/
FactSystem
/
ParameterManagerTest
.
h
\
src
/
MissionManager
/
CameraCalcTest
.
h
\
src
/
MissionManager
/
CameraSectionTest
.
h
\
src
/
MissionManager
/
CorridorScanComplexItemTest
.
h
\
src
/
MissionManager
/
FWLandingPatternTest
.
h
\
src
/
MissionManager
/
MissionCommandTreeTest
.
h
\
src
/
MissionManager
/
MissionControllerManagerTest
.
h
\
src
/
MissionManager
/
MissionControllerTest
.
h
\
src
/
MissionManager
/
MissionItemTest
.
h
\
src
/
MissionManager
/
MissionManagerTest
.
h
\
src
/
MissionManager
/
MissionSettingsTest
.
h
\
src
/
MissionManager
/
PlanMasterControllerTest
.
h
\
src
/
MissionManager
/
QGCMapPolygonTest
.
h
\
src
/
MissionManager
/
QGCMapPolylineTest
.
h
\
src
/
MissionManager
/
SectionTest
.
h
\
src
/
MissionManager
/
SimpleMissionItemTest
.
h
\
src
/
MissionManager
/
SpeedSectionTest
.
h
\
src
/
MissionManager
/
StructureScanComplexItemTest
.
h
\
src
/
MissionManager
/
SurveyComplexItemTest
.
h
\
src
/
MissionManager
/
TransectStyleComplexItemTest
.
h
\
src
/
MissionManager
/
VisualMissionItemTest
.
h
\
src
/
qgcunittest
/
GeoTest
.
h
\
src
/
qgcunittest
/
LinkManagerTest
.
h
\
src
/
qgcunittest
/
MavlinkLogTest
.
h
\
src
/
qgcunittest
/
MultiSignalSpy
.
h
\
src
/
qgcunittest
/
TCPLinkTest
.
h
\
src
/
qgcunittest
/
TCPLoopBackServer
.
h
\
src
/
qgcunittest
/
UnitTest
.
h
\
src
/
Vehicle
/
SendMavCommandTest
.
h
\
#
src
/
qgcunittest
/
RadioConfigTest
.
h
\
#
src
/
AnalyzeView
/
LogDownloadTest
.
h
\
#
src
/
qgcunittest
/
FileDialogTest
.
h
\
#
src
/
qgcunittest
/
FileManagerTest
.
h
\
#
src
/
qgcunittest
/
FlightGearTest
.
h
\
#
src
/
qgcunittest
/
MainWindowTest
.
h
\
#
src
/
qgcunittest
/
MessageBoxTest
.
h
\
SOURCES
+=
\
src
/
Audio
/
AudioOutputTest
.
cc
\
src
/
FactSystem
/
FactSystemTestBase
.
cc
\
src
/
FactSystem
/
FactSystemTestGeneric
.
cc
\
src
/
FactSystem
/
FactSystemTestPX4
.
cc
\
src
/
FactSystem
/
ParameterManagerTest
.
cc
\
src
/
MissionManager
/
CameraCalcTest
.
cc
\
src
/
MissionManager
/
CameraSectionTest
.
cc
\
src
/
MissionManager
/
CorridorScanComplexItemTest
.
cc
\
src
/
MissionManager
/
FWLandingPatternTest
.
cc
\
src
/
MissionManager
/
MissionCommandTreeTest
.
cc
\
src
/
MissionManager
/
MissionControllerManagerTest
.
cc
\
src
/
MissionManager
/
MissionControllerTest
.
cc
\
src
/
MissionManager
/
MissionItemTest
.
cc
\
src
/
MissionManager
/
MissionManagerTest
.
cc
\
src
/
MissionManager
/
MissionSettingsTest
.
cc
\
src
/
MissionManager
/
PlanMasterControllerTest
.
cc
\
src
/
MissionManager
/
QGCMapPolygonTest
.
cc
\
src
/
MissionManager
/
QGCMapPolylineTest
.
cc
\
src
/
MissionManager
/
SectionTest
.
cc
\
src
/
MissionManager
/
SimpleMissionItemTest
.
cc
\
src
/
MissionManager
/
SpeedSectionTest
.
cc
\
src
/
MissionManager
/
StructureScanComplexItemTest
.
cc
\
src
/
MissionManager
/
SurveyComplexItemTest
.
cc
\
src
/
MissionManager
/
TransectStyleComplexItemTest
.
cc
\
src
/
MissionManager
/
VisualMissionItemTest
.
cc
\
src
/
qgcunittest
/
GeoTest
.
cc
\
src
/
qgcunittest
/
LinkManagerTest
.
cc
\
src
/
qgcunittest
/
MavlinkLogTest
.
cc
\
src
/
qgcunittest
/
MultiSignalSpy
.
cc
\
src
/
qgcunittest
/
TCPLinkTest
.
cc
\
src
/
qgcunittest
/
TCPLoopBackServer
.
cc
\
src
/
qgcunittest
/
UnitTest
.
cc
\
src
/
qgcunittest
/
UnitTestList
.
cc
\
src
/
Vehicle
/
SendMavCommandTest
.
cc
\
#
src
/
qgcunittest
/
RadioConfigTest
.
cc
\
#
src
/
AnalyzeView
/
LogDownloadTest
.
cc
\
#
src
/
qgcunittest
/
FileDialogTest
.
cc
\
#
src
/
qgcunittest
/
FileManagerTest
.
cc
\
#
src
/
qgcunittest
/
FlightGearTest
.
cc
\
#
src
/
qgcunittest
/
MainWindowTest
.
cc
\
#
src
/
qgcunittest
/
MessageBoxTest
.
cc
\
}
}
}
}
}
}
#
Main
QGC
Headers
and
Source
files
HEADERS
+=
\
...
...
@@ -458,7 +555,6 @@ HEADERS += \
src
/
QGCApplication
.
h
\
src
/
QGCComboBox
.
h
\
src
/
QGCConfig
.
h
\
src
/
QGCDockWidget
.
h
\
src
/
QGCFileDownload
.
h
\
src
/
QGCGeo
.
h
\
src
/
QGCLoggingCategory
.
h
\
...
...
@@ -636,7 +732,6 @@ SOURCES += \
src
/
QGC
.
cc
\
src
/
QGCApplication
.
cc
\
src
/
QGCComboBox
.
cc
\
src
/
QGCDockWidget
.
cc
\
src
/
QGCFileDownload
.
cc
\
src
/
QGCGeo
.
cc
\
src
/
QGCLoggingCategory
.
cc
\
...
...
src/Airmap/AirMapFlightManager.h
View file @
6e11fae8
...
...
@@ -18,8 +18,6 @@
#include <QList>
#include <QGeoCoordinate>
//-- TODO: This is not even WIP yet. Just a skeleton of what's to come.
//-----------------------------------------------------------------------------
/// class to upload a flight
class
AirMapFlightManager
:
public
QObject
,
public
LifetimeChecker
...
...
src/AutoPilotPlugins/Common/RadioComponentController.h
View file @
6e11fae8
...
...
@@ -37,7 +37,7 @@ class RadioComponentController : public FactPanelController
{
Q_OBJECT
friend
class
RadioConfigTest
;
///< This allows our unit test to access internal information needed.
//
friend class RadioConfigTest; ///< This allows our unit test to access internal information needed.
public:
RadioComponentController
(
void
);
...
...
src/FactSystem/FactSystemTestBase.cc
View file @
6e11fae8
...
...
@@ -18,7 +18,6 @@
#endif
#include "MultiVehicleManager.h"
#include "QGCApplication.h"
#include "QGCQuickWidget.h"
#include "ParameterManager.h"
#include <QQuickItem>
...
...
@@ -69,6 +68,8 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void)
/// Test that QML can reference a Fact
void
FactSystemTestBase
::
_qml_test
(
void
)
{
//-- TODO
#if 0
QGCQuickWidget* widget = new QGCQuickWidget;
widget->setAutoPilot(_plugin);
...
...
@@ -83,11 +84,14 @@ void FactSystemTestBase::_qml_test(void)
QCOMPARE(qmlValue.toInt(), 3);
delete widget;
#endif
}
/// Test QML getting an updated Fact value
void
FactSystemTestBase
::
_qmlUpdate_test
(
void
)
{
//-- TODO
#if 0
QGCQuickWidget* widget = new QGCQuickWidget;
widget->setAutoPilot(_plugin);
...
...
@@ -109,5 +113,6 @@ void FactSystemTestBase::_qmlUpdate_test(void)
QCOMPARE(control->property("text").toInt(), 12);
delete widget;
#endif
}
src/VehicleSetup/JoystickConfigController.h
View file @
6e11fae8
...
...
@@ -36,7 +36,7 @@ class JoystickConfigController : public FactPanelController
{
Q_OBJECT
friend
class
RadioConfigTest
;
///< This allows our unit test to access internal information needed.
//
friend class RadioConfigTest; ///< This allows our unit test to access internal information needed.
public:
JoystickConfigController
(
void
);
...
...
src/main.cc
View file @
6e11fae8
...
...
@@ -203,7 +203,7 @@ int main(int argc, char *argv[])
CmdLineOpt_t
rgCmdLineOptions
[]
=
{
{
"--unittest"
,
&
runUnitTests
,
&
unitTestOptions
},
{
"--unittest-stress"
,
&
stressUnitTests
,
&
unitTestOptions
},
{
"--no-windows-assert-ui"
,
&
quietWindowsAsserts
,
NULL
},
{
"--no-windows-assert-ui"
,
&
quietWindowsAsserts
,
nullptr
},
// Add additional command line option flags here
};
...
...
src/qgcunittest/MavlinkLogTest.cc
View file @
6e11fae8
...
...
@@ -14,7 +14,6 @@
/// @author Don Gagne <don@thegagnes.com>
#include "MavlinkLogTest.h"
#include "MainWindow.h"
#include "MockLink.h"
#include "QGCTemporaryFile.h"
#include "QGCApplication.h"
...
...
src/qgcunittest/UnitTest.cc
View file @
6e11fae8
...
...
@@ -16,7 +16,6 @@
#include "UnitTest.h"
#include "QGCApplication.h"
#include "MAVLinkProtocol.h"
#include "MainWindow.h"
#include "Vehicle.h"
#include <QTemporaryFile>
...
...
@@ -34,10 +33,10 @@ enum UnitTest::FileDialogType UnitTest::_fileDialogExpectedType = getOpenFileNam
int
UnitTest
::
_missedFileDialogCount
=
0
;
UnitTest
::
UnitTest
(
void
)
:
_linkManager
(
NULL
)
,
_mockLink
(
NULL
)
,
_mainWindow
(
NULL
)
,
_vehicle
(
NULL
)
:
_linkManager
(
nullptr
)
,
_mockLink
(
nullptr
)
,
_mainWindow
(
nullptr
)
,
_vehicle
(
nullptr
)
,
_expectMissedFileDialog
(
false
)
,
_expectMissedMessageBox
(
false
)
,
_unitTestRun
(
false
)
...
...
@@ -146,6 +145,8 @@ void UnitTest::cleanup(void)
void
UnitTest
::
setExpectedMessageBox
(
QMessageBox
::
StandardButton
response
)
{
//-- TODO
#if 0
// This means that there was an expected message box but no call to checkExpectedMessageBox
Q_ASSERT(!_messageBoxRespondedTo);
...
...
@@ -154,14 +155,16 @@ void UnitTest::setExpectedMessageBox(QMessageBox::StandardButton response)
// Make sure we haven't missed any previous message boxes
int missedMessageBoxCount = _missedMessageBoxCount;
_missedMessageBoxCount
=
0
;
QCOMPARE(missedMessageBoxCount, 0);
#endif
_missedMessageBoxCount
=
0
;
_messageBoxResponseButton
=
response
;
}
void
UnitTest
::
setExpectedFileDialog
(
enum
FileDialogType
type
,
QStringList
response
)
{
//-- TODO
#if 0
// This means that there was an expected file dialog but no call to checkExpectedFileDialog
Q_ASSERT(!_fileDialogRespondedTo);
...
...
@@ -172,7 +175,7 @@ void UnitTest::setExpectedFileDialog(enum FileDialogType type, QStringList respo
int missedFileDialogCount = _missedFileDialogCount;
_missedFileDialogCount = 0;
QCOMPARE(missedFileDialogCount, 0);
#endif
_fileDialogResponseSet
=
true
;
_fileDialogResponse
=
response
;
_fileDialogExpectedType
=
type
;
...
...
@@ -410,25 +413,30 @@ void UnitTest::_disconnectMockLink(void)
linkSpy
.
wait
(
1000
);
QCOMPARE
(
linkSpy
.
count
(),
1
);
_vehicle
=
NULL
;
_vehicle
=
nullptr
;
}
}
void
UnitTest
::
_linkDeleted
(
LinkInterface
*
link
)
{
if
(
link
==
_mockLink
)
{
_mockLink
=
NULL
;
_mockLink
=
nullptr
;
}
}
void
UnitTest
::
_createMainWindow
(
void
)
{
//-- TODO
#if 0
_mainWindow = MainWindow::_create();
Q_CHECK_PTR(_mainWindow);
#endif
}
void
UnitTest
::
_closeMainWindow
(
bool
cancelExpected
)
{
//-- TODO
#if 0
if (_mainWindow) {
QSignalSpy mainWindowSpy(_mainWindow, SIGNAL(mainWindowClosed()));
...
...
@@ -441,6 +449,9 @@ void UnitTest::_closeMainWindow(bool cancelExpected)
// This prevents qWarning from bad references in Qml
QTest::qWait(1000);
}
#else
Q_UNUSED
(
cancelExpected
);
#endif
}
QString
UnitTest
::
createRandomFile
(
uint32_t
byteCount
)
...
...
src/qgcunittest/UnitTestList.cc
View file @
6e11fae8
...
...
@@ -13,24 +13,24 @@
#include "FactSystemTestGeneric.h"
#include "FactSystemTestPX4.h"
#include "FileDialogTest.h"
#include "FlightGearTest.h"
//
#include "FileDialogTest.h"
//
#include "FlightGearTest.h"
#include "GeoTest.h"
#include "LinkManagerTest.h"
#include "MessageBoxTest.h"
//
#include "MessageBoxTest.h"
#include "MissionItemTest.h"
#include "SimpleMissionItemTest.h"
#include "SurveyComplexItemTest.h"
#include "MissionControllerTest.h"
#include "MissionManagerTest.h"
#include "RadioConfigTest.h"
//
#include "RadioConfigTest.h"
#include "MavlinkLogTest.h"
#include "MainWindowTest.h"
#include "FileManagerTest.h"
//
#include "MainWindowTest.h"
//
#include "FileManagerTest.h"
#include "TCPLinkTest.h"
#include "ParameterManagerTest.h"
#include "MissionCommandTreeTest.h"
#include "LogDownloadTest.h"
//
#include "LogDownloadTest.h"
#include "SendMavCommandTest.h"
#include "VisualMissionItemTest.h"
#include "CameraSectionTest.h"
...
...
@@ -48,21 +48,21 @@
UT_REGISTER_TEST
(
FactSystemTestGeneric
)
UT_REGISTER_TEST
(
FactSystemTestPX4
)
UT_REGISTER_TEST
(
FileDialogTest
)
UT_REGISTER_TEST
(
FlightGearUnitTest
)
//
UT_REGISTER_TEST(FileDialogTest)
//
UT_REGISTER_TEST(FlightGearUnitTest)
UT_REGISTER_TEST
(
GeoTest
)
UT_REGISTER_TEST
(
LinkManagerTest
)
UT_REGISTER_TEST
(
MessageBoxTest
)
//
UT_REGISTER_TEST(MessageBoxTest)
UT_REGISTER_TEST
(
MissionItemTest
)
UT_REGISTER_TEST
(
SimpleMissionItemTest
)
UT_REGISTER_TEST
(
MissionControllerTest
)
UT_REGISTER_TEST
(
MissionManagerTest
)
UT_REGISTER_TEST
(
RadioConfigTest
)
//
UT_REGISTER_TEST(RadioConfigTest)
UT_REGISTER_TEST
(
TCPLinkTest
)
UT_REGISTER_TEST
(
FileManagerTest
)
//
UT_REGISTER_TEST(FileManagerTest)
UT_REGISTER_TEST
(
ParameterManagerTest
)
UT_REGISTER_TEST
(
MissionCommandTreeTest
)
UT_REGISTER_TEST
(
LogDownloadTest
)
//
UT_REGISTER_TEST(LogDownloadTest)
UT_REGISTER_TEST
(
SendMavCommandTest
)
UT_REGISTER_TEST
(
SurveyComplexItemTest
)
UT_REGISTER_TEST
(
CameraSectionTest
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment