From a45a5756f1974086a4330ba2b7534eb70fc0af67 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Wed, 25 Dec 2013 15:17:08 -0800 Subject: [PATCH] AutoTest runner is now part of main --- src/main.cc | 24 +++++++++++++++++++++++- src/qgcunittest/testSuite.cc | 28 ---------------------------- 2 files changed, 23 insertions(+), 29 deletions(-) delete mode 100755 src/qgcunittest/testSuite.cc diff --git a/src/main.cc b/src/main.cc index b3658b6507..398ff65aa7 100644 --- a/src/main.cc +++ b/src/main.cc @@ -32,7 +32,7 @@ This file is part of the QGROUNDCONTROL project #include "QGCCore.h" #include "MainWindow.h" #include "configuration.h" - +#include "AutoTest.h" /* SDL does ugly things to main() */ #ifdef main @@ -68,6 +68,28 @@ int main(int argc, char *argv[]) #ifdef Q_OS_WIN qInstallMsgHandler( msgHandler ); #endif + +#ifdef QT_DEBUG + if (argc > 1 && QString(argv[1]).compare("--unittest", Qt::CaseInsensitive) == 0) { + // Strip off extra command line args so QTest doesn't complain + for (int i=1; i - -#if 1 -// This is all you need to run all the tests -TEST_MAIN -#else -// Or supply your own main function -int main(int argc, char *argv[]) -{ - int failures = AutoTest::run(argc, argv); - if (failures == 0) - { - qDebug() << "ALL TESTS PASSED"; - } - else - { - qDebug() << failures << " TESTS FAILED!"; - } - return failures; -} -#endif -- GitLab