File size: 1,292 Bytes
7e59e4c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | // Copyright (C) 2021 by Pedro Mendes, Rector and Visitors of the
// University of Virginia, University of Heidelberg, and University
// of Connecticut School of Medicine.
// All rights reserved.
/**
* Main Entry point for all tests (defines catch main, and only one
* test file can do it). This file is there to include utility
* functions used in all other test files.
*/
// now include catch
#define CATCH_CONFIG_RUNNER
#include "catch.hpp"
#include <string.h>
#include <cstdlib>
#define COPASI_MAIN
#include <copasi/core/CRootContainer.h>
/**
* Tries to find the test file in the srcdir environment variable.
*
* @param fileName the filename relative to this tests srcdir
* environment variable.
*
* If the filename cannot be found, the test from which this function
* is called will fail.
*
* @return the full path to the test file
*/
std::string getTestFile(const std::string& fileName)
{
std::stringstream str;
char* srcDir = getenv("srcdir");
if (srcDir != NULL) str << srcDir;
else str << ".";
str << "/" << fileName;
std::string fullName = str.str();
return fullName;
}
int main(int argc, char *argv[])
{
CRootContainer::init(0, NULL);
int result = Catch::Session().run(argc, argv);
CRootContainer::destroy();
return result;
}
|