[all-commits] [llvm/llvm-project] dd0fdf: [lldb] Add support for checking children in expect...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Wed Aug 12 03:12:02 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dd0fdf80301e0b875d1898e01542c43b991e1b1c
      https://github.com/llvm/llvm-project/commit/dd0fdf80301e0b875d1898e01542c43b991e1b1c
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-08-12 (Wed, 12 Aug 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lldbtest.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py

  Log Message:
  -----------
  [lldb] Add support for checking children in expect_expr

expect_expr currently can't verify the children of the result SBValue.

This patch adds the ability to check them. The idea is to have a CheckValue
class where one can specify what attributes of a SBValue should be checked.
Beside the properties we already check for (summary, type, etc.) this also
has a list of children which is again just a list of CheckValue object (which
can also have children of their own).

The main motivation is to make checking the children no longer based
on error-prone substring checks that allow tests to pass just because
for example the error message contains the expected substrings by accident.

I also expect that we can just have a variant of `expect_expr` for LLDB's
expression paths (aka 'frame var') feature.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D83792




More information about the All-commits mailing list