James Henderson 1364750dad [RFC][debuginfo-test] Rename debug-info lit tests for general purposes
Discussion thread:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148048.html

Move debuginfo-test into a subdirectory of a new top-level directory,
called cross-project-tests. The new name replaces "debuginfo-test" as an
LLVM project enabled via LLVM_ENABLE_PROJECTS.

Differential Revision: https://reviews.llvm.org/D95339

Reviewed by: aprantl
2021-06-28 11:31:40 +01:00

43 lines
1.2 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
"""Command used to give a line in a test a named psuedonym. Every DexLabel has
a line number and Label string component.
"""
from dex.command.CommandBase import CommandBase
class DexLabel(CommandBase):
def __init__(self, label, **kwargs):
if not isinstance(label, str):
raise TypeError('invalid argument type')
try:
self.on_line = kwargs.pop('on_line')
except KeyError:
# We cannot use self.lineno because it hasn't been set yet.
pass
if kwargs:
raise TypeError(f'unexpected named args: {", ".join(kwargs)}')
self._label = label
super(DexLabel, self).__init__()
def get_line(self):
return getattr(self, 'on_line', self.lineno)
def get_as_pair(self):
return (self._label, self.get_line())
@staticmethod
def get_name():
return __class__.__name__
def eval(self):
return self._label