diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 352ce6fabf16..169f43f59c2f 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -750,6 +750,10 @@ class Base(unittest2.TestCase): """Return absolute path to an artifact in the test's build directory.""" return os.path.join(self.getBuildDir(), name) + def getSourcePath(self, name): + """Return absolute path to a file in the test's source directory.""" + return os.path.join(self.getSourceDir(), name) + @classmethod def setUpCommands(cls): commands = [ diff --git a/lldb/test/API/commands/statistics/basic/TestStats.py b/lldb/test/API/commands/statistics/basic/TestStats.py index 5f9e7b0ca9e2..838b270f75a9 100644 --- a/lldb/test/API/commands/statistics/basic/TestStats.py +++ b/lldb/test/API/commands/statistics/basic/TestStats.py @@ -93,12 +93,18 @@ class TestCase(TestBase): substrs=["undeclared identifier 'doesnt_exist'"]) # Doesn't successfully execute. self.expect("expr int *i = nullptr; *i", error=True) - # Interpret an integer as an array with 3 elements is also a failure. + # Interpret an integer as an array with 3 elements is a failure for + # the "expr" command, but the expression evaluation will succeed and + # be counted as a success even though the "expr" options will for the + # command to fail. It is more important to track expression evaluation + # from all sources instead of just through the command, so this was + # changed. If we want to track command success and fails, we can do + # so using another metric. self.expect("expr -Z 3 -- 1", error=True, substrs=["expression cannot be used with --element-count"]) # We should have gotten 3 new failures and the previous success. stats = self.get_stats() - self.verify_success_fail_count(stats, 'expressionEvaluation', 1, 3) + self.verify_success_fail_count(stats, 'expressionEvaluation', 2, 2) self.expect("statistics enable") # 'frame var' with enabled statistics will change stats.