src: replaced unit test framework CxxTest with Catch2

This commit is contained in:
mlangkabel
2019-10-29 19:54:16 +01:00
parent 48c4bddc1b
commit 49050e1089
82 changed files with 28319 additions and 14175 deletions
+39
View File
@@ -0,0 +1,39 @@
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() function
#include "catch.hpp"
// IMPORTANT NOTE: removed signal listener for "EXCEPTION_ACCESS_VIOLATION" from catch source code because it interferes with the jni interface that emits such a signal on purpose
#include "ApplicationSettings.h"
struct EventListener : Catch::TestEventListenerBase
{
using TestEventListenerBase::TestEventListenerBase; // inherit constructor
void testRunStarting(const Catch::TestRunInfo& testRunInfo) override
{
#ifdef __linux__
const std::string homedir = getenv("HOME");
if (!homedir.empty())
{
if(!ApplicationSettings::getInstance()->load(
FilePath(homedir + "/.config/sourcetrail/ApplicationSettings.xml")
))
{
std::cout << "no settings" << std::endl;
return false;
}
}
else
{
std::cout << "no homedir" << std::endl;
return false;
}
#else
ApplicationSettings::getInstance()->load(FilePath(L"data/TestSettings.xml"));
#endif
}
};
CATCH_REGISTER_LISTENER(EventListener)