From bc7f4da406fbd802b08985ba583e52f040bdba85 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 14 Nov 2026 00:06:35 +0000 Subject: Layout: cmd/, src/, test/, everything built into obj/ The tree had grown sideways: main.c living among the sources it dispatches to, one test binary covering everything, object files left in the source directory because the Makefile put them there and, worse, tracked them. Now the command line is cmd/main.c, the engine is src/ and nothing in it knows about the command line, and each area of the engine has its own program under test/ - glob, norm, parse, need, check - each linking the library and reporting its own count. A failure says which area broke instead of taking the whole run down with a single "unit: 171" line, which is the only thing a per-file split buys and it is worth the small duplication the shared test.h absorbs. Objects go to obj/, test runners to obj/test_runner/, so a build leaves the tree as it found it. The stale src/*.o and tests/unit that were committed earlier are gone; they were build output in a source tree and the .gitignore that should have stopped them arrived after they did. The Makefile follows the same shape as the other C trees here: directories in variables, wildcards for the sources, one pattern rule that makes its own directory, test runners built from the same objects as the binary so they cannot test a different build than ships, and `test` running every runner with a foreach so the first failure stops the line. `strict` is `all` with -Werror, which is what CI now calls instead of passing CFLAGS in from outside; the sanitizer and install targets are unchanged in what they do. Behaviour is unchanged: 171 direct checks and 154 behavioural ones, same as before the move, and make install still stages a working hook symlink. --- ci/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ci/build.yaml') diff --git a/ci/build.yaml b/ci/build.yaml index e8db98c..d881096 100644 --- a/ci/build.yaml +++ b/ci/build.yaml @@ -53,7 +53,7 @@ jobs: apk add --no-cache build-base git >/dev/null cd repo make clean - make WARN="-Wall -Wextra -Wpedantic -Werror" 2>&1 | tail -3 + make strict 2>&1 | tail -3 make test | tail -1 make clean make sanitizer | tail -1 -- cgit v1.2.3