From fd305341fc810ebd52f4b4df85a808261e39d320 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 31 Jul 2025 14:19:18 +0200 Subject: [PATCH] Test that make lib can build generated files even when GEN_FILES is off Test that `make lib GEN_FILES=` does build the generated files if they're missing. Also, test that this only requires the expected commands: `$(CC)`, `$(AR)`, `$(PERL)` and `$(PYTHON)`. For Python (and Perl), we don't test for reliance on unexpected third-party packages: that would be desirable, but out of scope of this commit. Signed-off-by: Gilles Peskine --- tests/scripts/components-build-system.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/scripts/components-build-system.sh b/tests/scripts/components-build-system.sh index 0ba5aafd8c..f9a71a1d48 100644 --- a/tests/scripts/components-build-system.sh +++ b/tests/scripts/components-build-system.sh @@ -59,6 +59,19 @@ component_build_make_no_gen_files () { # even if it isn't on $PATH. msg "build: make lib with GEN_FILES off in minimal environment" env PATH=/no/such/directory "$(command -v make)" GEN_FILES= AR="$AR" CC="$CC" lib + + msg "build: make -C library clean with GEN_FILES off in minimal environment" + env PATH=/no/such/directory "$(command -v make)" GEN_FILES= RM="$RM" -C library clean + + msg "build: make lib with GEN_FILES off with generated files missing" + make neat + # Check that a sample generated file is absent + not test -f library/error.c + PERL="$(command -v perl)" + PYTHON="$(command -v python3)" + # We take whatever Python environment we're in. For a future improvement, + # make a venv with just scripts/basic.requirements.txt. + env PATH=/no/such/directory "$(command -v make)" GEN_FILES= AR="$AR" CC="$CC" PERL="$PERL" PYTHON="$PYTHON" lib } support_test_cmake_out_of_source () {