fsfw/tests/src/fsfw_tests/unit/CatchRunner.cpp
Robin Mueller ade15ad16d
tests can now be built as part of FSFW
This PR refactores the tests so they are built as part of the FSFW.
This is done by adding Catch2 with the FetchContent directive.

A future implementation might also use a system installation of Catch2
by first checking whether Catch2 can already be found as a package

The custom configuration folder testcfg was moved from the user folder
to the actual unittest folder.

The tests can be built by setting the CMake FSFW_BUILD_UNITTESTS option
to TRUE/ON. They are built with the static library and dropped inside
the build folders fsfw directory.
2021-10-07 13:24:46 +02:00

27 lines
579 B
C++

/**
* @file CatchRunner.cpp
* @brief Source file to compile catch framework.
* @details All tests should be written in other files.
* For eclipse console output, install ANSI Escape in Console
* from the eclipse market place to get colored characters.
*/
#include "CatchRunner.h"
#define CATCH_CONFIG_COLOUR_WINDOWS
#include <catch2/catch_session.hpp>
extern int customSetup();
int main(int argc, char* argv[]) {
customSetup();
// Catch internal function call
int result = Catch::Session().run(argc, argv);
// global clean-up
return result;
}