summaryrefslogtreecommitdiff
path: root/cpp/src/tests/test_tools.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2009-11-30 19:34:36 +0000
committerAlan Conway <aconway@apache.org>2009-11-30 19:34:36 +0000
commit7a70ee7193a85ceb52cbfe3df2684e947cee9456 (patch)
tree3f8c78519d4169bc7c0ec8015a684879527a5350 /cpp/src/tests/test_tools.h
parentd3e2aeef6229259be003071988706c934677ff43 (diff)
downloadqpid-python-7a70ee7193a85ceb52cbfe3df2684e947cee9456.tar.gz
Clean up test environment variables, prepare for running more tests in cmake.
- consolidate test env vars in test_env.sh, also useful from command line. - generate test_env.sh with autoconf/cmake to cover library location differences. - Remove explicit mention of .libs, use $QPID_MODULE_DIR to load modules. - Fix run_test to run valgrind under cmake git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@885557 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/test_tools.h')
-rw-r--r--cpp/src/tests/test_tools.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/tests/test_tools.h b/cpp/src/tests/test_tools.h
index 4174751173..bb2509fd32 100644
--- a/cpp/src/tests/test_tools.h
+++ b/cpp/src/tests/test_tools.h
@@ -28,6 +28,8 @@
#include <vector>
#include <set>
#include <ostream>
+#include <sstream>
+#include <exception>
// Print a sequence
template <class T> std::ostream& seqPrint(std::ostream& o, const T& seq) {
@@ -106,8 +108,11 @@ 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.");
+ if (defaultPath == 0) {
+ std::ostringstream msg;
+ msg << "Environment variable " << envName << " not set.";
+ throw std::runtime_error(msg.str());
+ }
return defaultPath;
}