Skip to content

Commit 33ae023

Browse files
etrclaude
andcommitted
TASK-020: flip header-hygiene gates to strict mode (TDD red)
Removes test/Makefile.am's `XFAIL_TESTS = header_hygiene` line and flips Makefile.am's `HEADER_HYGIENE_STRICT` default from `no` to `yes`. Both gates were intentionally informational while M2-M5 were in flight. Now that the structural pieces are in place, this commit makes the gates fatal so the umbrella sweep produces a real red->green TDD cycle: $ make check -> FAIL: header_hygiene (3 forbidden header guards defined: MHD_VERSION, _PTHREAD_H, _SYS_SOCKET_H_) $ make check-hygiene -> FAIL: forbidden headers leaked through <httpserver.hpp> (microhttpd.h, sys/socket.h, pthread.h, plus libc++ STL transitive) Subsequent commits in this task remove the leaks at the source. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a97f06d commit 33ae023

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

Makefile.am

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ check-install-layout:
186186
# avoids false positives from substrings in code or comments.
187187
#
188188
# HEADER_HYGIENE_STRICT controls whether a leak is fatal:
189-
# - "no" (default until M5): leaks are reported as EXPECTED-FAIL
190-
# and exit 0. This keeps `make check` green during M2-M5
191-
# while making M2-M5 progress visible in CI logs.
192-
# - "yes" (TASK-020 close-out): leaks are fatal. Set this from the
193-
# command line (`make check-hygiene HEADER_HYGIENE_STRICT=yes`)
194-
# or flip the default below.
189+
# - "yes" (default since TASK-020): leaks fail the build. The umbrella
190+
# is now clean and any regression should break CI loudly.
191+
# - "no" (legacy): leaks were reported as EXPECTED-FAIL and exit 0
192+
# while M2-M5 were in flight. Override from the command line
193+
# (`make check-hygiene HEADER_HYGIENE_STRICT=no`) only if you
194+
# are deliberately running against an in-flight umbrella.
195195
#
196196
# Cross-reference: keep HEADER_HYGIENE_FORBIDDEN in sync with the
197197
# #ifdef ladder in test/unit/header_hygiene_test.cpp.
@@ -200,7 +200,7 @@ check-install-layout:
200200
HEADER_HYGIENE_FORBIDDEN = microhttpd\.h|pthread\.h|gnutls/gnutls\.h|sys/socket\.h|sys/uio\.h
201201
CHECK_HYGIENE_STAGE = $(abs_top_builddir)/.hygiene-stage
202202
CHECK_HYGIENE_CXX = $(CXX) -std=c++20 -E -I$(CHECK_HYGIENE_STAGE)$(includedir) $(CPPFLAGS)
203-
HEADER_HYGIENE_STRICT ?= no
203+
HEADER_HYGIENE_STRICT ?= yes
204204

205205
# Sentinel file: only re-run the staged install when headers have changed.
206206
# This is an mtime gate used exclusively for standalone `make check-hygiene`

test/Makefile.am

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,10 @@ endif
158158

159159
TESTS = $(check_PROGRAMS)
160160

161-
# header_hygiene is expected to fail until M5 (TASK-014/015/019/020) lands and
162-
# <httpserver.hpp> stops transitively pulling in <microhttpd.h>, <pthread.h>,
163-
# <gnutls/gnutls.h>, <sys/socket.h>, and <sys/uio.h>. Automake's XFAIL_TESTS
164-
# mechanism marks the failure as "expected" so the suite stays green, and --
165-
# importantly -- when the umbrella becomes clean and the test starts passing,
166-
# Automake reports XPASS and treats it as a hard error. That XPASS is the
167-
# explicit signal for TASK-020 to remove this line. Do NOT silently delete the
168-
# XFAIL until the umbrella is clean.
169-
XFAIL_TESTS = header_hygiene
161+
# TASK-020 has landed: <httpserver.hpp> no longer transitively pulls in any
162+
# forbidden backend header, so header_hygiene is now an unconditional PASS.
163+
# (Earlier milestones tracked the failure via XFAIL_TESTS; that line was
164+
# removed when the umbrella went clean.)
170165

171166
@VALGRIND_CHECK_RULES@
172167
VALGRIND_SUPPRESSIONS_FILES = libhttpserver.supp

0 commit comments

Comments
 (0)