Add a function to make it easier to debug a test failure caused by an unexpected state. Currently, tests are using assertEqual which results in a cryptic error message: "AssertionError: 5 != 10". Even when a test provides a message to make it clear why a particular state is expected, you still have to figure out which of the two numbers was the expected state and what the actual state corresponds to. We have a function in lldbutil that helps you convert the state number into a user readable string. This patch adds a wrapper around assertEqual specifically for comparing states. The aforementioned error message now looks like this: "AssertionError: 5 != 10 : stopped != exited". If the user provided a message, that gets displayed as well.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Pretty cool but it would be nice to have the following formatting: "AssertionError: stopped (5) != exited (10) : message" ... I feel like it's easier to read this way
Comment Actions
Implement Ismail's suggestion:
AssertionError: stopped (5) != exited (10) : Got exit event