@@ -59,16 +59,18 @@ function set_cmake {
59
59
# cmake -DWITH_DOC=ON -DBUILD_DOXY=ON ..
60
60
61
61
# 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 ..
63
63
64
+ # Building with debug on
64
65
# 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 ..
65
66
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 ..
68
69
69
70
# check link in documentation
70
71
# cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DES=ON -DLINKCHECK=ON -DCMAKE_BUILD_TYPE=Release ..
71
72
73
+ # build only english
72
74
cmake -DPOSTGRESQL_BIN=${PGBIN} -DDOC_USE_BOOTSTRAP=ON -DWITH_DOC=ON -DBUILD_DOXY=ON -DBUILD_LATEX=ON -DCMAKE_BUILD_TYPE=Debug ..
73
75
}
74
76
@@ -105,14 +107,16 @@ function set_compiler {
105
107
echo ------------------------------------
106
108
107
109
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 "
109
112
fi
110
113
}
111
114
112
115
function build_doc {
113
116
pushd build > /dev/null || exit 1
114
117
# 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
116
120
make doc
117
121
# example on how to only build spanish html
118
122
# make html-es
@@ -123,6 +127,30 @@ function build_doc {
123
127
popd > /dev/null || exit 1
124
128
}
125
129
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
+
126
154
function build {
127
155
pushd build > /dev/null || exit 1
128
156
set_cmake
@@ -141,25 +169,30 @@ function test_compile {
141
169
build
142
170
143
171
echo --------------------------------------------
144
- echo Execute tap_directories
172
+ echo Execute documentation queries
145
173
echo --------------------------------------------
146
- for d in ${TAP_DIRS }
174
+ for d in ${QUERIES_DIRS }
147
175
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} "
149
182
done
150
183
151
184
echo --------------------------------------------
152
- echo Execute documentation queries
185
+ echo Execute tap_directories
153
186
echo --------------------------------------------
154
- for d in ${QUERIES_DIRS }
187
+ for d in ${TAP_DIRS }
155
188
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} "
159
190
done
160
191
192
+ tap_test
193
+ tools/testers/doc_queries_generator.pl -pgport $PGPORT
194
+
161
195
build_doc
162
- # exit 0
163
196
tap_test
164
197
action_tests
165
198
}
0 commit comments