@@ -59,16 +59,18 @@ function set_cmake {
5959 # cmake -DWITH_DOC=ON -DBUILD_DOXY=ON ..
6060
6161 # Building using clang
62- # CXX=clang++ CC=clang cmake -DPOSTGRESQL_BIN=${PGBIN} -DCMAKE_BUILD_TYPE=Debug ..
62+ # CXX=clang++ CC=clang cmake -DPOSTGRESQL_BIN=${PGBIN} -DCMAKE_BUILD_TYPE=Debug -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=OFF ..
6363
64+ # Building with debug on
6465 # cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DCMAKE_BUILD_TYPE=Debug -DES=ON -DPROJECT_DEBUG=ON ..
6566
66- # building languages -DES=ON -DJA=ON -DZH_HANS=ON -DDE=ON -DKO=ON
67- # cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DES=ON -DCMAKE_BUILD_TYPE=Debug ..
67+ # building languages -DES=ON -DJA=ON -DZH_HANS=ON -DDE=ON -DKO=ON and CMAKE_EXPORT_COMPILE_COMMANDS for static analysis tools.
68+ # cmake -DPOSTGRESQL_BIN=${PGBIN} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DES=ON -DCMAKE_BUILD_TYPE=Debug ..
6869
6970 # check link in documentation
7071 # cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DES=ON -DLINKCHECK=ON -DCMAKE_BUILD_TYPE=Release ..
7172
73+ # build only english
7274 cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DCMAKE_BUILD_TYPE=Debug ..
7375}
7476
@@ -105,14 +107,16 @@ function set_compiler {
105107 echo ------------------------------------
106108
107109 if [ -n " $1 " ]; then
108- update-alternatives --set gcc " /usr/bin/gcc-$1 "
110+ export CC=" /usr/bin/gcc-$1 "
111+ export CXX=" /usr/bin/g++-$1 "
109112 fi
110113}
111114
112115function build_doc {
113116 pushd build > /dev/null || exit 1
114117 # rm -rf doc/* ; rm -rf locale/*/*/*.mo
115- rm -rf doc/*
118+ # Clean only generated files while preserving custom content
119+ find doc -type f \( -name " *.html" -o -name " *.pdf" \) -delete
116120 make doc
117121 # example on how to only build spanish html
118122 # make html-es
@@ -123,6 +127,30 @@ function build_doc {
123127 popd > /dev/null || exit 1
124128}
125129
130+ function check {
131+ pushd build > /dev/null || exit 1
132+ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
133+
134+ # Run with error handling and report generation
135+ cppcheck --project=compile_commands.json \
136+ --enable=all \
137+ --suppress=missingIncludeSystem \
138+ --error-exitcode=1 \
139+ --output-file=cppcheck-report.txt 2>&1 || {
140+ echo " Static analysis failed. See build/cppcheck-report.txt for details"
141+ return 1
142+ }
143+ popd > /dev/null || exit 1
144+ }
145+
146+ function tidy_with_clang {
147+ local base_branch=${1:- " upstream/develop" }
148+ .github/scripts/tidy-vs-commit.sh " $base_branch " || {
149+ echo " clang-tidy checks failed"
150+ return 1
151+ }
152+ }
153+
126154function build {
127155 pushd build > /dev/null || exit 1
128156 set_cmake
@@ -141,25 +169,30 @@ function test_compile {
141169 build
142170
143171 echo --------------------------------------------
144- echo Execute tap_directories
172+ echo Execute documentation queries
145173 echo --------------------------------------------
146- for d in ${TAP_DIRS }
174+ for d in ${QUERIES_DIRS }
147175 do
148- time bash taptest.sh " ${d} " " -p ${PGPORT} "
176+ # generate the documentation queries
177+ # tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -documentation -pgport "${PGPORT}"
178+ # Show warnings
179+ # tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -level WARNING -pgport "${PGPORT}"
180+ # Compare differences on results
181+ tools/testers/doc_queries_generator.pl -alg " docqueries/${d} " -pgport " ${PGPORT} "
149182 done
150183
151184 echo --------------------------------------------
152- echo Execute documentation queries
185+ echo Execute tap_directories
153186 echo --------------------------------------------
154- for d in ${QUERIES_DIRS }
187+ for d in ${TAP_DIRS }
155188 do
156- # tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -documentation -pgport "${PGPORT}"
157- # tools/testers/doc_queries_generator.pl -alg "docqueries/${d}" -debug1 -pgport "${PGPORT}"
158- tools/testers/doc_queries_generator.pl -alg " docqueries/${d} " -pgport " ${PGPORT} "
189+ time bash taptest.sh " ${d} " " -p ${PGPORT} "
159190 done
160191
192+ tap_test
193+ tools/testers/doc_queries_generator.pl -pgport $PGPORT
194+
161195 build_doc
162- # exit 0
163196 tap_test
164197 action_tests
165198}
0 commit comments