llvm-project/lldb
Raphael Isemann 13f22f5d59 [lldb] Add expect_expr function for testing expression evaluation in dotests.
Summary:
This patch adds a new function to lldbtest: `expect_expr`. This function is supposed to replace the current approach
of calling `expect`/`runCmd` with `expr`, `p` etc.

`expect_expr` allows evaluating expressions and matching their value/summary/type/error message without
having to do any string matching that might allow unintended passes (e.g., `self.expect("expr 3+4", substrs=["7"])`
can unexpectedly pass for results like `(Class7) $0 = 7`, `(int) $7 = 22`, `(int) $0 = 77` and so on).

This only uses the function in a few places to test and demonstrate it. I'll migrate the tests in follow up commits.

Reviewers: JDevlieghere, shafik, labath

Reviewed By: labath

Subscribers: christof, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70314
2020-01-15 13:04:04 +01:00
..
bindings [lldb] Fix that SBThread.GetStopDescription is returning strings with uninitialized memory at the end. 2020-01-14 09:34:32 +01:00
cmake [lldb/CMake] Only auto-enable Lua when SWIG is found 2020-01-08 14:02:47 -08:00
docs [lldb/Docs] Extend description section of the main page 2020-01-13 09:32:02 -08:00
examples [Examples] Move structured-data unpacking out of the loop. (NFC) 2019-11-22 15:43:39 -08:00
include/lldb [lldb/CommandInterpreter] Remove flag that's always true (NFC) 2020-01-14 22:28:49 -08:00
packages/Python/lldbsuite [lldb] Add expect_expr function for testing expression evaluation in dotests. 2020-01-15 13:04:04 +01:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts [lldb/Scripts] Remove SWIG bot 2020-01-13 09:23:48 -08:00
source [lldb/CommandInterpreter] Remove flag that's always true (NFC) 2020-01-14 22:28:49 -08:00
test [lldb/DWARF] Move location list sections into DWARFContext 2020-01-14 15:19:29 +01:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools [lldb-server] Prefer target_include_directories 2020-01-13 14:54:57 -08:00
unittests [lldb] Fix TestClangASTContext.TestFunctionTemplateInRecordConstruction in Debug builds 2020-01-10 21:34:07 +01:00
utils [lldb/Utils] Remove vim-lldb 2020-01-10 14:40:42 -08:00
.arcconfig
.clang-format
.gitignore Add .noindex to the gitignore 2019-04-05 17:57:42 +00:00
CMakeLists.txt [lldb/Bindings] Move bindings into their own subdirectory 2020-01-09 08:44:34 -08:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
use_lldb_suite_root.py