[all-commits] [llvm/llvm-project] 010d7a: [lldb/test] Catch invalid calls to expect()

Dave Lee via All-commits all-commits at lists.llvm.org
Mon Oct 5 12:42:19 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 010d7a388b146cafaf4bc0b28b952d5852d62b6a
      https://github.com/llvm/llvm-project/commit/010d7a388b146cafaf4bc0b28b952d5852d62b6a
  Author: Dave Lee <davelee.com at gmail.com>
  Date:   2020-10-05 (Mon, 05 Oct 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lldbtest.py
    M lldb/test/API/assert_messages_test/TestAssertMessages.py
    M lldb/test/API/commands/frame/diagnose/bad-reference/TestBadReference.py
    M lldb/test/API/commands/frame/diagnose/complicated-expression/TestComplicatedExpression.py
    M lldb/test/API/commands/frame/diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
    M lldb/test/API/commands/frame/diagnose/dereference-this/TestDiagnoseDereferenceThis.py
    M lldb/test/API/commands/frame/diagnose/inheritance/TestDiagnoseInheritance.py
    M lldb/test/API/commands/frame/diagnose/local-variable/TestLocalVariable.py
    M lldb/test/API/commands/frame/diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
    M lldb/test/API/commands/settings/TestSettings.py
    M lldb/test/API/driver/batch_mode/TestBatchMode.py
    M lldb/test/API/functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
    M lldb/test/API/functionalities/data-formatter/data-formatter-objc/cmtime/TestDataFormatterCMTime.py
    M lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
    M lldb/test/API/macosx/macCatalyst/TestMacCatalyst.py
    M lldb/test/API/types/TestRecursiveTypes.py

  Log Message:
  -----------
  [lldb/test] Catch invalid calls to expect()

Add preconditions to `TestBase.expect()` that catch semantically invalid calls
that happen to succeed anyway. This also fixes the broken callsites caught by
these 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




More information about the All-commits mailing list