diff options
Diffstat (limited to 'cpp/src/tests/test_tools.h')
| -rw-r--r-- | cpp/src/tests/test_tools.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cpp/src/tests/test_tools.h b/cpp/src/tests/test_tools.h index 37a6594f8a..54837d3e5b 100644 --- a/cpp/src/tests/test_tools.h +++ b/cpp/src/tests/test_tools.h @@ -89,6 +89,15 @@ struct ScopedSuppressLogging { qpid::log::Options opts; }; +inline std::string getLibPath(const char* envName, const char* defaultPath = 0) { + const char* p = std::getenv(envName); + if (p != 0) + return p; + if (defaultPath == 0) + BOOST_FAIL("Environment variable " << envName << " not set."); + return defaultPath; +} + #endif /*!TEST_TOOLS_H*/ |
