[llvm-commits] [PATCH v2] unittests/ExecutionEngine: use EngineBuilder::setErrorStr()
nobled
nobled at dreamwidth.org
Fri May 13 13:24:16 PDT 2011
If create() returned NULL, this prints the reason why before exiting.
---
unittests/ExecutionEngine/ExecutionEngineTest.cpp | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/unittests/ExecutionEngine/ExecutionEngineTest.cpp
b/unittests/ExecutionEngine/ExecutionEngineTest.cpp
index 904ee2b..57668a3 100644
--- a/unittests/ExecutionEngine/ExecutionEngineTest.cpp
+++ b/unittests/ExecutionEngine/ExecutionEngineTest.cpp
@@ -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)
+ << "Error building ExecutionEngine: " << Error;
}
GlobalVariable *NewExtGlobal(const Type *T, const Twine &Name) {
@@ -36,6 +37,7 @@ protected:
}
Module *const M;
+ std::string Error;
const OwningPtr<ExecutionEngine> Engine;
};
--
1.7.0.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-unittests-ExecutionEngine-use-EngineBuilder-setError.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110513/a2370c90/attachment.bin>
More information about the llvm-commits
mailing list