catch2.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /***************************************************************************
  2. catch2.h
  3. -----------------------
  4. begin : Aug 2021
  5. copyright : (C) 2021 by Matthias Kuhn
  6. email : matthias@opengis.ch
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. #ifdef QFIELDTEST_MAIN
  17. #define CATCH_CONFIG_RUNNER
  18. #endif
  19. #include <catch2/catch.hpp>
  20. #ifdef QFIELDTEST_MAIN
  21. #include <qgsapplication.h>
  22. int main( int argc, char *argv[] )
  23. {
  24. int ac = 0;
  25. char **av;
  26. QgsApplication app( ac, av, false );
  27. app.init();
  28. app.setPrefixPath( CMAKE_INSTALL_PREFIX, true );
  29. app.initQgis();
  30. app.setAttribute( Qt::AA_Use96Dpi, true );
  31. int result = Catch::Session().run( argc, argv );
  32. app.exitQgis();
  33. return result;
  34. }
  35. #endif
  36. QT_BEGIN_NAMESPACE
  37. std::ostream &operator << ( std::ostream &os, const QString &value )
  38. {
  39. os << qUtf8Printable( value );
  40. return os;
  41. }
  42. QT_END_NAMESPACE