Commit 446e137ef61619b24b9f6e9fec6a96f603bf8783

Authored by Jay Berkenbilt
Committed by GitHub
2 parents 7b4ecb60 7773fb38

Merge pull request #1616 from m-holger/private_hh

Add script to validate private header files in isolation
build-scripts/build-linux
... ... @@ -20,6 +20,9 @@ done
20 20 cd ..
21 21 # Perform additional tests on header files.
22 22 ./build-scripts/check-headers
  23 +# Perform additional tests on private header files.
  24 +./build-scripts/check-private-headers
  25 +# Create distribution
23 26 export TMPDIR=$PWD/dist-tmp
24 27 rm -rf $TMPDIR
25 28 ./make_dist --ci
... ...
build-scripts/check-private-headers 0 → 100755
  1 +#!/bin/bash
  2 +set -eo pipefail
  3 +cd "$(dirname $0)/.."
  4 +
  5 +trap "rm -f a.cc" EXIT
  6 +declare -a pheaders
  7 +cd libqpdf
  8 +for i in qpdf/*.hh; do
  9 + if [[ ! $i =~ .*auto_.* ]] && ! grep -q >/dev/null 2>&1 QPDFOBJECT_OLD_HH $i; then
  10 + pheaders+=($i)
  11 + fi
  12 +done
  13 +cd ..
  14 +# Make sure each header file can be included in isolation and that the
  15 +# result can be compiled with the version of the C++ standard used by the qpdf project, currently C++-20.
  16 +declare -a perrors
  17 +for i in "${pheaders[@]}"; do
  18 + rm -f a.cc
  19 + cat > a.cc <<EOF
  20 +#include "$i"
  21 +int main() { return 0; }
  22 +EOF
  23 + echo "Checking $i"
  24 + if ! g++ -std=c++20 -pedantic-errors -c -Iinclude -Ilibqpdf -Ibuild/libqpdf a.cc -o /dev/null; then
  25 + perrors+=("$i doesn't compile")
  26 + fi
  27 +done
  28 +if [[ ${#perrors[@]} -gt 0 ]]; then
  29 + echo ""
  30 + echo "Some header files had errors"
  31 + for i in "${perrors[@]}"; do
  32 + echo "$i"
  33 + done
  34 + exit 2
  35 +fi
... ...
manual/release-notes.rst
1 1 .. _ticket: https://issues.qpdf.org
2 2 .. _shared null: https://wiki.qpdf.org/PDF-null-objects-vs-qpdf-null-objects
3 3  
4   -
5 4 .. _release-notes:
6 5  
7 6 Release Notes
... ... @@ -79,8 +78,8 @@ more detail.
79 78  
80 79 - Build fixes
81 80  
82   - - Attempt to detect if any > C++-17 changes snuck into any public
83   - headers.
  81 + - Attempt to detect if any > C++17 changes snuck into any public
  82 + headers and check all private headers compile stand-alone.
84 83  
85 84 - CLI Enhancements
86 85  
... ...