This revision was automatically updated to reflect the committed changes.
Closed by commit rG0c118831a37a: [lldb] Let TestPExpectTest test the right test 
class (authored by teemperor).
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96556/new/

https://reviews.llvm.org/D96556

Files:
  lldb/packages/Python/lldbsuite/test/lldbpexpect.py
  lldb/test/API/test_utils/TestPExpectTest.py


Index: lldb/test/API/test_utils/TestPExpectTest.py
===================================================================
--- lldb/test/API/test_utils/TestPExpectTest.py
+++ lldb/test/API/test_utils/TestPExpectTest.py
@@ -2,14 +2,9 @@
 Test the PExpectTest test functions.
 """
 
+from lldbsuite.test.lldbpexpect import *
 
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
-from lldbsuite.test.lldbtest import *
-from textwrap import dedent
-
-
-class TestPExpectTestCase(TestBase):
+class TestPExpectTestCase(PExpectTest):
 
     mydir = TestBase.compute_mydir(__file__)
     NO_DEBUG_INFO_TESTCASE = True
Index: lldb/packages/Python/lldbsuite/test/lldbpexpect.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbpexpect.py
+++ lldb/packages/Python/lldbsuite/test/lldbpexpect.py
@@ -53,11 +53,12 @@
 
     def expect(self, cmd, substrs=None):
         self.assertNotIn('\n', cmd)
-        self.child.sendline(cmd)
         # If 'substrs' is a string then this code would just check that every
         # character of the string is in the output.
         assert not isinstance(substrs, six.string_types), \
             "substrs must be a collection of strings"
+
+        self.child.sendline(cmd)
         if substrs is not None:
             for s in substrs:
                 self.child.expect_exact(s)


Index: lldb/test/API/test_utils/TestPExpectTest.py
===================================================================
--- lldb/test/API/test_utils/TestPExpectTest.py
+++ lldb/test/API/test_utils/TestPExpectTest.py
@@ -2,14 +2,9 @@
 Test the PExpectTest test functions.
 """
 
+from lldbsuite.test.lldbpexpect import *
 
-import lldb
-import lldbsuite.test.lldbutil as lldbutil
-from lldbsuite.test.lldbtest import *
-from textwrap import dedent
-
-
-class TestPExpectTestCase(TestBase):
+class TestPExpectTestCase(PExpectTest):
 
     mydir = TestBase.compute_mydir(__file__)
     NO_DEBUG_INFO_TESTCASE = True
Index: lldb/packages/Python/lldbsuite/test/lldbpexpect.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbpexpect.py
+++ lldb/packages/Python/lldbsuite/test/lldbpexpect.py
@@ -53,11 +53,12 @@
 
     def expect(self, cmd, substrs=None):
         self.assertNotIn('\n', cmd)
-        self.child.sendline(cmd)
         # If 'substrs' is a string then this code would just check that every
         # character of the string is in the output.
         assert not isinstance(substrs, six.string_types), \
             "substrs must be a collection of strings"
+
+        self.child.sendline(cmd)
         if substrs is not None:
             for s in substrs:
                 self.child.expect_exact(s)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to