2
2
3
3
set -eux
4
4
5
+ echo ' PostgreSQL installation' && echo -en' travis_fold:start:pg_install\\r'
6
+
5
7
sudo apt-get update
6
8
7
9
# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
@@ -46,15 +48,17 @@ config_path=$prefix/bin/pg_config
46
48
# exit code
47
49
status=0
48
50
51
+ echo -en' travis_fold:end:pg_install\\r'
52
+
49
53
# perform code analysis if necessary
50
54
if [$CHECK_TYPE = " static" ]; then
55
+ echo ' Static analysis' && echo -en' travis_fold:start:static_analysis\\r'
51
56
52
57
if [" $CC " = " clang" ]; then
53
58
sudo apt-get -y install -qq clang-$LLVM_VER
54
59
55
60
scan-build-$LLVM_VER --status-bugs \
56
61
make USE_PGXS=1 USE_ASSERT_CHECKING=1 PG_CONFIG=$config_path || status=$?
57
- exit $status
58
62
59
63
elif [" $CC " = " gcc" ]; then
60
64
sudo apt-get -y install -qq cppcheck
@@ -70,22 +74,15 @@ if [ $CHECK_TYPE = "static" ]; then
70
74
cat cppcheck.log
71
75
status=1# error
72
76
fi
73
-
74
- exit $status
75
77
fi
76
78
77
79
# don't forget to "make clean"
78
80
make clean USE_PGXS=1 PG_CONFIG=$config_path
81
+ echo -en' travis_fold:end:static_analysis\\r'
82
+ exit $status
79
83
fi
80
84
81
-
82
- # create cluster 'test'
83
- CLUSTER_PATH=$( pwd) /test_cluster
84
- $initdb_path -D$CLUSTER_PATH -U$USER -A trust
85
-
86
- # enable core dumps and specify their path
87
- ulimit -c unlimited -S
88
- echo ' /tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern
85
+ echo ' Build extension' && echo -en' travis_fold:start:build_extension\\r'
89
86
90
87
# build extension (using CFLAGS_SL for gcov)
91
88
if [$CHECK_TYPE == " valgrind" ]; then
100
97
status=$?
101
98
if [$status -ne 0 ]; then exit $status ; fi
102
99
100
+ echo -en' travis_fold:end:build_extension\\r'
101
+
102
+ echo ' Run tests' && echo -en' travis_fold:start:run_tests\\r'
103
+
104
+ # enable core dumps and specify their path
105
+ ulimit -c unlimited -S
106
+ echo ' /tmp/%e-%s-%p.core' | sudo tee /proc/sys/kernel/core_pattern
107
+
103
108
# set permission to write postgres locks
104
109
sudo chown$USER /var/run/postgresql/
105
110
111
+ # create cluster 'test'
112
+ CLUSTER_PATH=$( pwd) /test_cluster
113
+ $initdb_path -D$CLUSTER_PATH -U$USER -A trust
114
+
106
115
# start cluster 'test'
107
116
echo " port = 55435" >> $CLUSTER_PATH /postgresql.conf
108
117
if [$CHECK_TYPE = " valgrind" ]; then
@@ -121,6 +130,10 @@ PGPORT=55435 PGUSER=$USER PG_CONFIG=$config_path make installcheck USE_PGXS=1 ||
121
130
# stop cluster
122
131
$pg_ctl_path -D$CLUSTER_PATH stop -l postgres.log -w
123
132
133
+ echo -en' travis_fold:end:run_tests\\r'
134
+
135
+ echo ' Check output' && echo -en' travis_fold:start:output\\r'
136
+
124
137
# show diff if it exists
125
138
if test -f regression.diffs; then cat regression.diffs; fi
126
139
@@ -142,11 +155,17 @@ for corefile in $(find /tmp/ -name '*.core' 2>/dev/null) ; do
142
155
gdb --batch --quiet -ex" thread apply all bt full" -ex" quit" $binary $corefile
143
156
done
144
157
158
+ echo -en' travis_fold:end:output\\r'
159
+
160
+ echo ' Coverage check' && echo -en' travis_fold:start:coverage\\r'
161
+
145
162
# generate *.gcov files
146
163
if [$CC = " clang" ]; then
147
164
bash<( curl -s https://codecov.io/bash) -x" llvm-cov gcov"
148
165
else
149
166
bash<( curl -s https://codecov.io/bash)
150
167
fi
151
168
169
+ echo -en' travis_fold:end:coverage\\r'
170
+
152
171
exit $status