cb424d7448
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).
38 lines
1.5 KiB
C++
38 lines
1.5 KiB
C++
namespace ns {
|
|
int bar;
|
|
}
|
|
|
|
int main() { return ns:: }
|
|
int main2() { return ns::foo(). }
|
|
int main3() { PREAMBLE_ }
|
|
|
|
// RUN: printf "namespace ns { struct foo { int baz }; }\n#define PREAMBLE_MAC" > %t.h
|
|
// RUN: c-index-test -write-pch %t.h.pch -x c++-header %t.h
|
|
//
|
|
// RUN: c-index-test -code-completion-at=%s:5:26 -include %t.h %s | FileCheck -check-prefix=WITH-PCH %s
|
|
// WITH-PCH: {TypedText bar}
|
|
// WITH-PCH: {TypedText foo}
|
|
|
|
// RUN: c-index-test -code-completion-at=%s:7:24 -include %t.h %s | FileCheck -check-prefix=WITH-PCH-MACRO %s
|
|
// WITH-PCH-MACRO: {TypedText PREAMBLE_MAC}
|
|
|
|
// RUN: env CINDEXTEST_COMPLETION_SKIP_PREAMBLE=1 c-index-test -code-completion-at=%s:5:26 -include %t.h %s | FileCheck -check-prefix=SKIP-PCH %s
|
|
// SKIP-PCH-NOT: foo
|
|
// SKIP-PCH: {TypedText bar}
|
|
// SKIP-PCH-NOT: foo
|
|
|
|
// RUN: env CINDEXTEST_COMPLETION_SKIP_PREAMBLE=1 c-index-test -code-completion-at=%s:7:24 -include %t.h %s | FileCheck -check-prefix=SKIP-PCH-MACRO %s
|
|
// SKIP-PCH-MACRO-NOT: {TypedText PREAMBLE_MAC}
|
|
|
|
// Verify that with *no* preamble (no -include flag) we still get local results.
|
|
// SkipPreamble used to break this, by making lookup *too* lazy.
|
|
// RUN: env CINDEXTEST_COMPLETION_SKIP_PREAMBLE=1 c-index-test -code-completion-at=%s:5:26 %s | FileCheck -check-prefix=NO-PCH %s
|
|
// NO-PCH-NOT: foo
|
|
// NO-PCH: {TypedText bar}
|
|
// NO-PCH-NOT: foo
|
|
|
|
// Verify that we still get member results from the preamble.
|
|
// RUN: env CINDEXTEST_COMPLETION_SKIP_PREAMBLE=1 c-index-test -code-completion-at=%s:6:32 -include %t.h %s | FileCheck -check-prefix=MEMBER %s
|
|
// MEMBER: {TypedText baz}
|
|
|