[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://r
[lldb][tests] Automatically call compute_mydir (NFC)Eliminate boilerplate of having each test manually assign to `mydir` by calling`compute_mydir` in lldbtest.py.Differential Revision: https://reviews.llvm.org/D128077
show more ...
[lldb] XFAIL tests that aren't passing remotelyXFAIL a series of tests that are failing remotely.
[lldb] Introduce createTestTarget for creating a valid target in API testsAt the moment nearly every test calls something similar to`self.dbg.CreateTarget(self.getBuildArtifact("a.out"))` and them
[lldb] Introduce createTestTarget for creating a valid target in API testsAt the moment nearly every test calls something similar to`self.dbg.CreateTarget(self.getBuildArtifact("a.out"))` and them sometimeschecks 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 arealways just indicating that the target failed to be created but now why.This patch introduces a helper function `createTestTarget` to our Test classthat creates the target with the much more verbose `CreateTarget` overload thatgives us back an SBError (with a fancy error). If the target couldn't be createdthe function prints out the SBError that LLDB returned and asserts for us. Italso defaults to the "a.out" build artifact path that nearly all tests are usingto 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 thetest suite as follow ups.Reviewed By: JDevlieghereDifferential Revision: https://reviews.llvm.org/D102771
[lldb/test] Catch invalid calls to expect()Add preconditions to `TestBase.expect()` that catch semantically invalid callsthat happen to succeed anyway. This also fixes the broken callsites caught
[lldb/test] Catch invalid calls to expect()Add preconditions to `TestBase.expect()` that catch semantically invalid callsthat happen to succeed anyway. This also fixes the broken callsites caught bythese checks.This prevents the following incorrect calls:1. `self.expect("lldb command", "some substr")`2. `self.expect("lldb command", "assert message", "some substr")`Differential Revision: https://reviews.llvm.org/D88792
[lldb] Improve test failure reporting for expect()This updates the errors reported by expect()to something like:```Ran command:"help"Got output:Debugger commands:<...>Expecting start str
[lldb] Improve test failure reporting for expect()This updates the errors reported by expect()to something like:```Ran command:"help"Got output:Debugger commands:<...>Expecting start string: "Debugger commands:" (was found)Expecting end string: "foo" (was not found)```(see added tests for more examples)This shows the user exactly what was run,what checks passed and which failed. Along withwhether that check was supposed to pass.(including what regex patterns matched)These lines are also output to the testtrace file, whether the test passes or not.Note that expect() will still fail at the first failedcheck, in line with previous behaviour.Also I have flipped the wording of the assertmessage functions (.*_MSG) to describe failuresnot successes. This makes more sense as they areonly shown on assert failures.Reviewed By: labathDifferential Revision: https://reviews.llvm.org/D86792