main.cpp 496 B

123456789101112131415161718192021222324
  1. #include "QTestSuite.h"
  2. #include <QtTest/QTest>
  3. #include <QDebug>
  4. #include "Engine.h"
  5. int main(int argc, char* argv[])
  6. {
  7. new QCoreApplication(argc, argv);
  8. Engine::init(true);
  9. int numsuites = QTestSuite::suites().size();
  10. qDebug() << ">> Will run" << numsuites << "test suites";
  11. int failed = 0;
  12. for (QTestSuite*& suite : QTestSuite::suites())
  13. {
  14. failed += QTest::qExec(suite, argc, argv);
  15. }
  16. qDebug() << "<<" << failed << "out of"<<numsuites<<"test suites failed.";
  17. return failed;
  18. }