Skip to content

Commit 910838f

Browse files
committed
1 parent 93d0ade commit 910838f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ def getBuildArtifact(self, name="a.out"):
750750
"""Return absolute path to an artifact in the test's build directory."""
751751
return os.path.join(self.getBuildDir(), name)
752752

753+
def getSourcePath(self, name):
754+
"""Return absolute path to a file in the test's source directory."""
755+
return os.path.join(self.getSourceDir(), name)
756+
753757
@classmethod
754758
def setUpCommands(cls):
755759
commands = [

lldb/test/API/commands/statistics/basic/TestStats.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ def test_expressions_frame_var_counts(self):
9393
substrs=["undeclared identifier 'doesnt_exist'"])
9494
# Doesn't successfully execute.
9595
self.expect("expr int *i = nullptr; *i", error=True)
96-
# Interpret an integer as an array with 3 elements is also a failure.
96+
# Interpret an integer as an array with 3 elements is a failure for
97+
# the "expr" command, but the expression evaluation will succeed and
98+
# be counted as a success even though the "expr" options will for the
99+
# command to fail. It is more important to track expression evaluation
100+
# from all sources instead of just through the command, so this was
101+
# changed. If we want to track command success and fails, we can do
102+
# so using another metric.
97103
self.expect("expr -Z 3 -- 1", error=True,
98104
substrs=["expression cannot be used with --element-count"])
99105
# We should have gotten 3 new failures and the previous success.
100106
stats = self.get_stats()
101-
self.verify_success_fail_count(stats, 'expressionEvaluation', 1, 3)
107+
self.verify_success_fail_count(stats, 'expressionEvaluation', 2, 2)
102108

103109
self.expect("statistics enable")
104110
# 'frame var' with enabled statistics will change stats.

0 commit comments

Comments
 (0)