22
33set -eux
44
5+ echo -en ' travis_fold:start:pg_install\\r' && echo ' PostgreSQL installation'
6+
57sudo apt-get update
68
79# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
@@ -46,16 +48,18 @@ config_path=$prefix/bin/pg_config
4648# exit code
4749status=0
4850
51+ echo -en ' travis_fold:end:pg_install\\r'
52+
4953# perform code analysis if necessary
5054if [ $CHECK_TYPE = " static" ]; then
55+ echo -en ' travis_fold:start:static_analysis\\r' && echo ' Static analysis'
5156
5257 if [ " $CC " = " clang" ]; then
5358 sudo apt-get -y install -qq clang-$LLVM_VER
5459
5560 scan-build-$LLVM_VER --status-bugs \
5661 -disable-checker deadcode.DeadStores \
5762 make USE_PGXS=1 USE_ASSERT_CHECKING=1 PG_CONFIG=$config_path || status=$?
58- exit $status
5963
6064 elif [ " $CC " = " gcc" ]; then
6165 sudo apt-get -y install -qq cppcheck
@@ -71,22 +75,15 @@ if [ $CHECK_TYPE = "static" ]; then
7175 cat cppcheck.log
7276 status=1 # error
7377 fi
74-
75- exit $status
7678 fi
7779
7880 # don't forget to "make clean"
7981 make clean USE_PGXS=1 PG_CONFIG=$config_path
82+ echo -en ' travis_fold:end:static_analysis\\r'
83+ exit $status
8084fi
8185
82-
83- # create cluster 'test'
84- CLUSTER_PATH=$( pwd) /test_cluster
85- $initdb_path -D $CLUSTER_PATH -U $USER -A trust
86-
87- # enable core dumps and specify their path
88- ulimit -c unlimited -S
89- echo ' /tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern
86+ echo -en ' travis_fold:start:build_extension\\r' && echo ' Build extension'
9087
9188# build extension (using CFLAGS_SL for gcov)
9289if [ $CHECK_TYPE == " valgrind" ]; then
10198status=$?
10299if [ $status -ne 0 ]; then exit $status ; fi
103100
101+ echo -en ' travis_fold:end:build_extension\\r'
102+
103+ echo -en ' travis_fold:start:run_tests\\r' && echo ' Run tests'
104+
105+ # enable core dumps and specify their path
106+ ulimit -c unlimited -S
107+ echo ' /tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern
108+
104109# set permission to write postgres locks
105110sudo chown $USER /var/run/postgresql/
106111
112+ # create cluster 'test'
113+ CLUSTER_PATH=$( pwd) /test_cluster
114+ $initdb_path -D $CLUSTER_PATH -U $USER -A trust
115+
107116# start cluster 'test'
108117echo " port = 55435" >> $CLUSTER_PATH /postgresql.conf
109118if [ $CHECK_TYPE = " valgrind" ]; then
@@ -122,6 +131,10 @@ PGPORT=55435 PGUSER=$USER PG_CONFIG=$config_path make installcheck USE_PGXS=1 ||
122131# stop cluster
123132$pg_ctl_path -D $CLUSTER_PATH stop -l postgres.log -w
124133
134+ echo -en ' travis_fold:end:run_tests\\r'
135+
136+ echo -en ' travis_fold:start:output\\r' && echo ' Check output'
137+
125138# show diff if it exists
126139if test -f regression.diffs; then cat regression.diffs; fi
127140
@@ -143,11 +156,17 @@ for corefile in $(find /tmp/ -name '*.core' 2>/dev/null) ; do
143156 gdb --batch --quiet -ex " thread apply all bt full" -ex " quit" $binary $corefile
144157done
145158
159+ echo -en ' travis_fold:end:output\\r'
160+
161+ echo -en ' travis_fold:start:coverage\\r' && echo ' Coverage check'
162+
146163# generate *.gcov files
147164if [ $CC = " clang" ]; then
148165 bash <( curl -s https://codecov.io/bash) -x " llvm-cov gcov"
149166else
150167 bash <( curl -s https://codecov.io/bash)
151168fi
152169
170+ echo -en ' travis_fold:end:coverage\\r'
171+
153172exit $status
0 commit comments