@@ -14,10 +14,6 @@ set -ux
1414status=0
1515
1616
17- # show pg_config just in case
18- pg_config
19-
20-
2117# rebuild PostgreSQL with cassert + valgrind support
2218if [ " $LEVEL " = " hardcore" ] || \
2319 [ " $LEVEL " = " nightmare" ]; then
@@ -46,7 +42,7 @@ if [ "$LEVEL" = "hardcore" ] || \
4642
4743 # enable additional options
4844 ./configure \
49- --enable-debug \
45+ CFLAGS= ' -O0 -ggdb3 -fno-omit-frame-pointer ' \
5046 --enable-cassert \
5147 --prefix=$CUSTOM_PG_BIN
5248
@@ -64,6 +60,9 @@ if [ "$LEVEL" = "hardcore" ] || \
6460 set +e
6561fi
6662
63+ # show pg_config just in case
64+ pg_config
65+
6766# perform code checks if asked to
6867if [ " $LEVEL " = " scan-build" ] || \
6968 [ " $LEVEL " = " hardcore" ] || \
8180
8281
8382# build and install extension (using PG_CPPFLAGS and SHLIB_LINK for gcov)
84- make USE_PGXS=1 PG_CPPFLAGS=" -coverage" SHLIB_LINK=" -coverage"
85- make USE_PGXS=1 install
83+ make USE_PGXS=1 PG_CPPFLAGS=" -coverage" SHLIB_LINK=" -coverage" install
8684
8785# initialize database
8886initdb -D $PGDATA
@@ -96,13 +94,16 @@ if [ "$LEVEL" = "nightmare" ]; then
9694 ls $CUSTOM_PG_BIN /bin
9795
9896 valgrind \
97+ --tool=memcheck \
9998 --leak-check=no \
10099 --time-stamp=yes \
100+ --track-origins=yes \
101101 --trace-children=yes \
102102 --gen-suppressions=all \
103103 --suppressions=$CUSTOM_PG_SRC /src/tools/valgrind.supp \
104+ --suppressions=$PWD /valgrind.supp \
104105 --log-file=/tmp/valgrind-%p.log \
105- postgres -l /tmp/postgres.log -w || status=$?
106+ pg_ctl start -l /tmp/postgres.log -w || status=$?
106107else
107108 pg_ctl start -l /tmp/postgres.log -w || status=$?
108109fi
@@ -132,7 +133,6 @@ if test -f regression.diffs; then cat regression.diffs; fi
132133if [ $status -ne 0 ]; then exit 1; fi
133134
134135# generate *.gcov files
135- rm -f * serialize.{gcda,gcno}
136136gcov * .c * .h
137137
138138
0 commit comments