Browse Source

Merge pull request #2170 from DonLakeFlyer/UT

Unit Tests that will run with QT_FATAL_WARNINGS=1
QGC4.4
Don Gagne 10 years ago
parent
commit
2cd9ce2dd2
  1. 2
      .travis.yml
  2. 6
      src/VehicleSetup/SetupViewTest.cc
  3. 4
      src/qgcunittest/UnitTest.cc

2
.travis.yml

@ -22,7 +22,7 @@ matrix:
sudo: false sudo: false
- os: osx - os: osx
osx_image: xcode7 osx_image: xcode7
env: SPEC=macx-clang CONFIG=debug env: SPEC=macx-clang CONFIG=debug QT_FATAL_WARNINGS=1
- os: osx - os: osx
osx_image: xcode7 osx_image: xcode7
env: SPEC=macx-clang CONFIG=installer env: SPEC=macx-clang CONFIG=installer

6
src/VehicleSetup/SetupViewTest.cc

@ -63,10 +63,6 @@ void SetupViewTest::_clickThrough_test(void)
QTest::qWait(1000); QTest::qWait(1000);
} }
// On MainWindow close we should get a message box telling the user to disconnect first. _disconnectMockLink();
setExpectedMessageBox(QGCMessageBox::Yes);
_closeMainWindow(); _closeMainWindow();
checkExpectedMessageBox();
} }

4
src/qgcunittest/UnitTest.cc

@ -417,5 +417,9 @@ void UnitTest::_closeMainWindow(bool cancelExpected)
mainWindowSpy.wait(2000); mainWindowSpy.wait(2000);
QCOMPARE(mainWindowSpy.count(), cancelExpected ? 0 : 1); QCOMPARE(mainWindowSpy.count(), cancelExpected ? 0 : 1);
// This leaves enough time for any dangling Qml components to get cleaned up.
// This prevents qWarning from bad references in Qml
QTest::qWait(1000);
} }
} }

Loading…
Cancel
Save