Files
RedBear-OS/local/recipes/dev/libclc/source/openmp/libompd/test/lit.cfg
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

84 lines
2.9 KiB
INI

# -*- Python -*- vim: set ft=python ts=4 sw=4 expandtab tw=79:
# Configuration file for the 'lit' test runner.
import os
import re
import subprocess
import lit.formats
# Tell pylint that we know config and lit_config exist somewhere.
if 'PYLINT_IMPORT' in os.environ:
config = object()
lit_config = object()
def append_dynamic_library_path(path):
if config.operating_system == 'Windows':
name = 'PATH'
sep = ';'
elif config.operating_system == 'Darwin':
name = 'DYLD_LIBRARY_PATH'
sep = ':'
else:
name = 'LD_LIBRARY_PATH'
sep = ':'
if name in config.environment:
config.environment[name] = path + sep + config.environment[name]
else:
config.environment[name] = path
# config.environment['PYTHONPATH'] = config.ompd_module + sep + config.environment['PYTHON_PATH']
# name: The name of this test suite.
config.name = 'ompd-test'
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c']
# test_source_root: The root path where tests are located.
#config.test_source_root = os.path.dirname(__file__)
config.test_source_root = config.ompd_test_src
# test_exec_root: The root object directory where output is placed
config.test_exec_root = config.ompd_obj_root
# test format
config.test_format = lit.formats.ShTest()
# compiler flags
config.test_flags = " -I " + config.test_source_root + " -I " + config.ompt_include_dir + \
" " + config.test_extra_flags + " -L " + config.library_dir
append_dynamic_library_path(config.library_dir)
append_dynamic_library_path(config.ompd_library_dir)
# Disable OMPT tests if FileCheck was not found
if config.test_filecheck == "":
lit_config.note("Not testing OMPT_OMPD because FileCheck was not found")
if 'Linux' in config.operating_system:
config.available_features.add("linux")
# to run with icc INTEL_LICENSE_FILE must be set
if 'INTEL_LICENSE_FILE' in os.environ:
config.environment['INTEL_LICENSE_FILE'] = os.environ['INTEL_LICENSE_FILE']
if 'OMP_NUM_THREADS' in os.environ:
config.environment['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']
#config.environment['ompd'] = "/home/gu620893/LLVM-openmp-master/install/"
config.substitutions.append(("%gdb-compile-and-run", "%gdb-compile && %gdb-run"))
config.substitutions.append(("%gdb-compile",
"%test_c_compiler -fopenmp -g -gdwarf-4 %s -o %t " + config.test_flags))
config.substitutions.append(("%test_c_compiler", config.test_c_compiler))
config.substitutions.append(("%gdb-run",
"env OMP_DEBUG=enabled gdb -x " + config.ompd_obj_root + "/../gdb-plugin/python-module/ompd/__init__.py -x " \
+ config.ompd_test_src + "/test.cmd %t "))
config.substitutions.append(("%gdb-test",
"env OMP_DEBUG=enabled gdb -x " + config.ompd_obj_root + "/../gdb-plugin/python-module/ompd/__init__.py "))
config.substitutions.append(("%ompt-tool",
config.ompt_plugin))
config.substitutions.append(("FileCheck", config.test_filecheck))