LCOV - code coverage report
Current view: top level - config - Config.inc (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 6 61 9.8 %
Date: 2020-11-18 11:20:57 Functions: 2 23 8.7 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2011-2019 The plumed team
       3             :    (see the PEOPLE file at the root of the distribution for a list of names)
       4             : 
       5             :    See http://www.plumed.org for more information.
       6             : 
       7             :    This file is part of plumed, version 2.
       8             : 
       9             :    plumed is free software: you can redistribute it and/or modify
      10             :    it under the terms of the GNU Lesser General Public License as published by
      11             :    the Free Software Foundation, either version 3 of the License, or
      12             :    (at your option) any later version.
      13             : 
      14             :    plumed is distributed in the hope that it will be useful,
      15             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      16             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17             :    GNU Lesser General Public License for more details.
      18             : 
      19             :    You should have received a copy of the GNU Lesser General Public License
      20             :    along with plumed.  If not, see <http://www.gnu.org/licenses/>.
      21             : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
      22             : 
      23             : #include "Config.h"
      24             : #include "version.h"
      25             : #include <cstdlib>
      26             : #include <cstring>
      27             : 
      28             : namespace PLMD {
      29             : namespace config {
      30             : 
      31             : // This is a fix to allow conda to correctly replace paths in binary files.
      32             : // These functions should not be static or they will be optimized away!
      33         224 : const char* plumed_root() {return "/home/runner/work/plumed2/plumed2/";}
      34           0 : const char* plumed_soext() {return "so";}
      35           0 : const char* plumed_htmldir() {return "xxxxNAxxxx";}
      36           0 : const char* plumed_includedir() {return "xxxxNAxxxx";}
      37           0 : const char* plumed_program_name() {return "xxxxNAxxxx";}
      38             : 
      39           0 : std::string getSoExt() {
      40           0 :   return plumed_soext();
      41             : }
      42             : 
      43           0 : bool isInstalled() {
      44           0 :   return false;
      45             : }
      46             : 
      47         224 : std::string getPlumedRoot() {
      48         224 :   char *env = std::getenv("PLUMED_ROOT");
      49             :   std::string ss;
      50         224 :   if( env == NULL) {
      51         224 :     ss=plumed_root();
      52             :   } else {
      53           0 :     ss=std::string( env );
      54             :   }
      55         224 :   return ss;
      56             : }
      57             : 
      58           0 : std::string getPlumedHtmldir() {
      59           0 :   if(!isInstalled()) return getPlumedRoot();
      60           0 :   char *env = std::getenv("PLUMED_HTMLDIR");
      61             :   std::string ss;
      62           0 :   if( env == NULL) {
      63           0 :     ss=plumed_htmldir();
      64             :   } else {
      65           0 :     ss=std::string( env );
      66             :   }
      67             :   return ss;
      68             : }
      69             : 
      70           0 : std::string getPlumedIncludedir() {
      71           0 :   if(!isInstalled()) return getPlumedRoot()+"/include";
      72           0 :   char *env = std::getenv("PLUMED_INCLUDEDIR");
      73             :   std::string ss;
      74           0 :   if( env == NULL) {
      75           0 :     ss=plumed_includedir();
      76             :   } else {
      77           0 :     ss=std::string( env );
      78             :   }
      79             :   return ss;
      80             : }
      81             : 
      82           0 : std::string getPlumedProgramName() {
      83           0 :   if(!isInstalled()) return "plumed";
      84           0 :   char *env = std::getenv("PLUMED_PROGRAM_NAME");
      85             :   std::string ss;
      86           0 :   if( env == NULL) {
      87           0 :     ss=plumed_program_name();
      88             :   } else {
      89           0 :     ss=std::string( env );
      90             :   }
      91             :   return ss;
      92             : }
      93             : 
      94           0 : std::string getEnvCommand() {
      95           0 :   return "env PLUMED_ROOT=\""+getPlumedRoot()+"\""+
      96           0 :          " env PLUMED_HTMLDIR=\""+getPlumedHtmldir()+"\""+
      97           0 :          " env PLUMED_INCLUDEDIR=\""+getPlumedIncludedir()+"\""+
      98           0 :          " env PLUMED_PROGRAM_NAME=\""+getPlumedProgramName()+"\""+
      99           0 :          " env PLUMED_IS_INSTALLED=\""+(false?"yes":"no")+"\"";
     100             : }
     101             : 
     102           0 : std::string getVersion() {
     103           0 :   return PLUMED_VERSION_SHORT;
     104             : }
     105             : 
     106           0 : std::string getVersionLong() {
     107           0 :   return PLUMED_VERSION_LONG;
     108             : }
     109             : 
     110           0 : std::string getVersionGit() {
     111           0 :   return PLUMED_VERSION_GIT;
     112             : }
     113             : 
     114           0 : std::string getMakefile() {
     115             :   static const char conf [] = {
     116             : #include "Makefile.conf.xxd"
     117             :     , 0x00
     118             :   };
     119           0 :   return std::string(conf,conf+std::strlen(conf));
     120             : }
     121             : 
     122           0 : bool hasMatheval() {
     123             : #if __PLUMED_HAS_MATHEVAL
     124           0 :   return true;
     125             : #else
     126             :   return false;
     127             : #endif
     128             : }
     129             : 
     130           0 : bool hasDlopen() {
     131             : #if __PLUMED_HAS_DLOPEN
     132           0 :   return true;
     133             : #else
     134             :   return false;
     135             : #endif
     136             : }
     137             : 
     138           0 : bool hasCregex() {
     139             : #if __PLUMED_HAS_CREGEX
     140           0 :   return true;
     141             : #else
     142             :   return false;
     143             : #endif
     144             : }
     145             : 
     146           0 : bool hasMolfile() {
     147             : #if __PLUMED_HAS_MOLFILE_PLUGINS
     148           0 :   return true;
     149             : #else
     150             :   return false;
     151             : #endif
     152             : }
     153             : 
     154           0 : bool hasExternalMolfile() {
     155             : #if __PLUMED_HAS_EXTERNAL_MOLFILE_PLUGINS
     156             :   return true;
     157             : #else
     158           0 :   return false;
     159             : #endif
     160             : }
     161             : 
     162           0 : bool hasZlib() {
     163             : #if __PLUMED_HAS_ZLIB
     164           0 :   return true;
     165             : #else
     166             :   return false;
     167             : #endif
     168             : }
     169             : 
     170           0 : bool hasXdrfile() {
     171             : #if __PLUMED_HAS_XDRFILE
     172           0 :   return true;
     173             : #else
     174             :   return false;
     175             : #endif
     176             : }
     177             : 
     178             : }
     179             : }
     180             : 

Generated by: LCOV version 1.13