diff --git a/src/main.cc b/src/main.cc index b3658b650779bf6ae9c298c74a7e85398efc3299..398ff65aa7758f3619095b1e3a34c78681a4861a 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