From 7773fb387517c2738f6e7982d10f2e16e6fa92f0 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 2 Dec 2025 12:24:12 +0000 Subject: [PATCH] Add script to validate private header files in isolation --- build-scripts/build-linux | 3 +++ build-scripts/check-private-headers | 35 +++++++++++++++++++++++++++++++++++ manual/release-notes.rst | 5 ++--- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100755 build-scripts/check-private-headers diff --git a/build-scripts/build-linux b/build-scripts/build-linux index a1216b9..139117b 100755 --- a/build-scripts/build-linux +++ b/build-scripts/build-linux @@ -20,6 +20,9 @@ done cd .. # Perform additional tests on header files. ./build-scripts/check-headers +# Perform additional tests on private header files. +./build-scripts/check-private-headers +# Create distribution export TMPDIR=$PWD/dist-tmp rm -rf $TMPDIR ./make_dist --ci diff --git a/build-scripts/check-private-headers b/build-scripts/check-private-headers new file mode 100755 index 0000000..dc8cab4 --- /dev/null +++ b/build-scripts/check-private-headers @@ -0,0 +1,35 @@ +#!/bin/bash +set -eo pipefail +cd "$(dirname $0)/.." + +trap "rm -f a.cc" EXIT +declare -a pheaders +cd libqpdf +for i in qpdf/*.hh; do + if [[ ! $i =~ .*auto_.* ]] && ! grep -q >/dev/null 2>&1 QPDFOBJECT_OLD_HH $i; then + pheaders+=($i) + fi +done +cd .. +# Make sure each header file can be included in isolation and that the +# result can be compiled with the version of the C++ standard used by the qpdf project, currently C++-20. +declare -a perrors +for i in "${pheaders[@]}"; do + rm -f a.cc + cat > a.cc < C++-17 changes snuck into any public - headers. + - Attempt to detect if any > C++17 changes snuck into any public + headers and check all private headers compile stand-alone. - CLI Enhancements -- libgit2 0.21.4