Files
RedBear-OS/local/recipes/dev/libclc/source/llvm/test/FileCheck/check-count.txt
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

115 lines
3.3 KiB
Plaintext

;
; Basic error checking.
;
this is something else
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR1 2>&1 \
; RUN: | FileCheck %s --check-prefix=ERRCOUNT1
CHECK-ERR1-COUNT-xx: this
ERRCOUNT1: [[@LINE-1]]:18: error: invalid count in -COUNT specification on prefix 'CHECK-ERR1'
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR2 2>&1 \
; RUN: | FileCheck %s --check-prefix=ERRCOUNT2
CHECK-ERR2-COUNT-0x1: something
ERRCOUNT2: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR2'
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR3 2>&1 \
; RUN: | FileCheck %s --check-prefix=ERRCOUNT3
CHECK-ERR3-COUNT-100x: else
ERRCOUNT3: [[@LINE-1]]:21: error: invalid count in -COUNT specification on prefix 'CHECK-ERR3'
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR4 2>&1 \
; RUN: | FileCheck %s --check-prefix=ERRCOUNT4
CHECK-ERR4-COUNT-0: else
ERRCOUNT4: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR4'
;
; Main functionality
;
this is duplicate
this is duplicate
this is not duplicate
this is duplicate
this is duplicate
this is duplicate
; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT1
CHECK-CNT1-COUNT-1: this is duplicate
CHECK-CNT1: this is duplicate
CHECK-CNT1-NEXT: this is not duplicate
; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT2
CHECK-CNT2-COUNT-2: this is duplicate
CHECK-CNT2: this is not duplicate
; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT3
CHECK-CNT3-COUNT-2: this is duplicate
CHECK-CNT3: this is not duplicate
CHECK-CNT3-COUNT-3: this is duplicate
CHECK-CNT3-NOT: {{^}}this is duplicate
; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT4
CHECK-CNT4-COUNT-5: this is duplicate
CHECK-CNT4-EMPTY:
Many-label:
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
-many-
; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNTMANY
CHECK-CNTMANY-COUNT-2: this is duplicate
CHECK-CNTMANY-LABEL: Many-label:
CHECK-CNTMANY-EMPTY:
CHECK-CNTMANY-COUNT-16: {{^}}-many-
CHECK-CNTMANY-EMPTY:
;
; Tests on mismatches:
;
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS1 2>&1 \
; RUN: | FileCheck %s --check-prefix=MISCOUNT1
CHECK-MIS1-COUNT-3: this is duplicate
CHECK-MIS1: {{^}}this is not duplicate
MISCOUNT1: [[@LINE-1]]:13: error: CHECK-MIS1: expected string not found in input
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS2 2>&1 \
; RUN: | FileCheck %s --check-prefix=MISCOUNT2
CHECK-MIS2-COUNT-10: {{^this is duplicate}}
CHECK-MIS2: {{^}}this is not duplicate
MISCOUNT2: [[@LINE-2]]:22: error: CHECK-MIS2-COUNT: expected string not found in input
; RUN: %ProtectFileCheckOutput \
; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS3 2>&1 \
; RUN: | FileCheck %s --check-prefix=MISCOUNT3
CHECK-MIS3-COUNT-5: this is duplicate
CHECK-MIS3-EMPTY:
CHECK-MIS3-LABEL: Many-label:
CHECK-MIS3-EMPTY:
CHECK-MIS3-COUNT-160: {{^}}-many-
CHECK-MIS3-EMPTY:
MISCOUNT3: [[@LINE-2]]:23: error: CHECK-MIS3-COUNT: expected string not found in input (17 out of 160)