text: // Copyright (C) 2019 - 2020 by Pedro Mendes, Rector and Visitors of the
  // University of Virginia, University of Heidelberg, and University
  // of Connecticut School of Medicine.
  // All rights reserved.
  
  // Copyright (C) 2018 by Pedro Mendes, Virginia Tech Intellectual
  // Properties, Inc., University of Heidelberg, and University of
  // of Connecticut School of Medicine.
  // All rights reserved.
  
  #define CATCH_CONFIG_MAIN
  #include "catch.hpp"
  
  #define COPASI_MAIN
  #include <copasi/CopasiTypes.h>
  
  
  #include <cstdlib>
  
  
  /**
   * 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;
  }
  