Skip to content

Commit f6f9f1d

Browse files
committed
unittests: add ErrorStr to ExecutionEngine test
Makes failures more self-explanatory. llvm-svn: 145704
1 parent 132bd62 commit f6f9f1d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/unittests/ExecutionEngine/ExecutionEngineTest.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ namespace {
2222
class ExecutionEngineTest : public testing::Test {
2323
protected:
2424
ExecutionEngineTest()
25-
: M(new Module("<main>", getGlobalContext())),
26-
Engine(EngineBuilder(M).create()) {
25+
: M(new Module("<main>", getGlobalContext())), Error(""),
26+
Engine(EngineBuilder(M).setErrorStr(&Error).create()) {
2727
}
2828

2929
virtual void SetUp() {
30-
ASSERT_TRUE(Engine.get() != NULL);
30+
ASSERT_TRUE(Engine.get() != NULL) << "EngineBuilder returned error: '"
31+
<< Error << "'";
3132
}
3233

3334
GlobalVariable *NewExtGlobal(Type *T, const Twine &Name) {
@@ -36,6 +37,7 @@ class ExecutionEngineTest : public testing::Test {
3637
}
3738

3839
Module *const M;
40+
std::string Error;
3941
const OwningPtr<ExecutionEngine> Engine;
4042
};
4143

0 commit comments

Comments
 (0)