Author: vedantk Date: Tue Sep 10 11:36:53 2019 New Revision: 371544 URL: http://llvm.org/viewvc/llvm-project?rev=371544&view=rev Log: [lldbtest] Add an "expected_cmd_failure" option to the filecheck helper
Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=371544&r1=371543&r2=371544&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Tue Sep 10 11:36:53 2019 @@ -2207,12 +2207,16 @@ class TestBase(Base): self, command, check_file, - filecheck_options = ''): + filecheck_options = '', + expect_cmd_failure = False): # Run the command. self.runCmd( command, + check=(not expect_cmd_failure), msg="FileCheck'ing result of `{0}`".format(command)) + self.assertTrue((not expect_cmd_failure) == self.res.Succeeded()) + # Get the error text if there was an error, and the regular text if not. output = self.res.GetOutput() if self.res.Succeeded() \ else self.res.GetError() _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits