mirror of https://gitee.com/bigwinds/arangodb
31 lines
855 B
C++
31 lines
855 B
C++
#define CATCH_CONFIG_RUNNER
|
|
|
|
#include <lib/Basics/ArangoGlobalContext.h>
|
|
#include "catch.hpp"
|
|
#include "ApplicationFeatures/ShellColorsFeature.h"
|
|
#include "Logger/Logger.h"
|
|
#include "Logger/LogAppender.h"
|
|
#include "Random/RandomGenerator.h"
|
|
|
|
char const* ARGV0 = "";
|
|
|
|
int main(int argc, char* argv[]) {
|
|
ARGV0 = argv[0];
|
|
arangodb::RandomGenerator::initialize(arangodb::RandomGenerator::RandomType::MERSENNE);
|
|
// global setup...
|
|
arangodb::Logger::initialize(false);
|
|
arangodb::LogAppender::addAppender("-");
|
|
|
|
arangodb::ShellColorsFeature sc(nullptr);
|
|
sc.prepare();
|
|
|
|
arangodb::ArangoGlobalContext ctx(1, const_cast<char**>(&ARGV0), ".");
|
|
ctx.exit(0); // set "good" exit code by default
|
|
|
|
int result = Catch::Session().run( argc, argv );
|
|
arangodb::Logger::shutdown();
|
|
// global clean-up...
|
|
|
|
return ( result < 0xff ? result : 0xff );
|
|
}
|