CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
39 lines
1.6 KiB
Python
39 lines
1.6 KiB
Python
# DExTer : Debugging Experience Tester
|
|
# ~~~~~~ ~ ~~ ~ ~~
|
|
#
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
"""Utilities for matching debugger output to script expected values."""
|
|
|
|
from typing import Any, Dict, List, Union
|
|
|
|
from dex.dextIR import ValueIR
|
|
from dex.test_script.Nodes import Expect, Value
|
|
|
|
|
|
class DebuggerExpectMatch:
|
|
"""Class that represents the match between a particular expected value for an Expect node and the actual debugger
|
|
output corresponding to the watched value for that node."""
|
|
|
|
def __init__(self, expect: Expect, expected, actual: ValueIR):
|
|
self.expect = expect
|
|
self.expected = expected
|
|
self.actual = actual
|
|
self.actual_result = self.expect.get_variable_result(self.actual)
|
|
self.match_result = (
|
|
self.expected is not None and str(self.expected) == self.actual_result
|
|
)
|
|
|
|
|
|
def get_expect_match(expect: Expect, expected_values, actual: ValueIR):
|
|
"""Given one or more expected values for an Expect node and an actual ValueIR, returns a match for the first
|
|
matching expected values, or for None if there are no matching expected values."""
|
|
if not isinstance(expected_values, list):
|
|
expected_values = [expected_values]
|
|
for expected_value in expected_values:
|
|
expect_match = DebuggerExpectMatch(expect, expected_value, actual)
|
|
if expect_match.match_result:
|
|
return expect_match
|
|
return DebuggerExpectMatch(expect, None, actual)
|