summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2021-05-24 16:01:48 +0200
committerRaphael Isemann <teemperor@gmail.com>2021-05-24 16:18:44 +0200
commit54c2687292da54a2d7964a47b0e334155385f084 (patch)
tree8589b51f4993d64855e1ec61f1141921b5f1d9c4 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent42a9c0c80c23fa0de3e3b00fef0dfa6d85e18e55 (diff)
[lldb] Introduce createTestTarget for creating a valid target in API tests
At the moment nearly every test calls something similar to `self.dbg.CreateTarget(self.getBuildArtifact("a.out"))` and them sometimes checks if the created target is actually valid with something like `self.assertTrue(target.IsValid(), "some useless text")`. Beside being really verbose the error messages generated by this pattern are always just indicating that the target failed to be created but now why. This patch introduces a helper function `createTestTarget` to our Test class that creates the target with the much more verbose `CreateTarget` overload that gives us back an SBError (with a fancy error). If the target couldn't be created the function prints out the SBError that LLDB returned and asserts for us. It also defaults to the "a.out" build artifact path that nearly all tests are using to avoid to hardcode "a.out" in every test. I converted a bunch of tests to the new function but I'll do the rest of the test suite as follow ups. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D102771
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions