unittests: add ErrorStr to ExecutionEngine test

Makes failures more self-explanatory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dylan Noblesmith 2011-12-02 20:53:53 +00:00
parent b74c865841
commit 35af1d7e2c

View File

@ -22,12 +22,13 @@ namespace {
class ExecutionEngineTest : public testing::Test {
protected:
ExecutionEngineTest()
: M(new Module("<main>", getGlobalContext())),
Engine(EngineBuilder(M).create()) {
: M(new Module("<main>", getGlobalContext())), Error(""),
Engine(EngineBuilder(M).setErrorStr(&Error).create()) {
}
virtual void SetUp() {
ASSERT_TRUE(Engine.get() != NULL);
ASSERT_TRUE(Engine.get() != NULL) << "EngineBuilder returned error: '"
<< Error << "'";
}
GlobalVariable *NewExtGlobal(Type *T, const Twine &Name) {
@ -36,6 +37,7 @@ protected:
}
Module *const M;
std::string Error;
const OwningPtr<ExecutionEngine> Engine;
};