2
2
3
3
set -eux
4
4
5
+ echo -en ' travis_fold:start:pg_install\\r' && echo ' PostgreSQL installation'
6
+
5
7
sudo apt-get update
6
8
7
9
# bug: http://www.postgresql.org/message-id/[email protected]
@@ -46,16 +48,18 @@ 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 -en ' travis_fold:start:static_analysis\\r' && echo ' Static analysis'
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
-disable-checker deadcode.DeadStores \
57
62
make USE_PGXS=1 USE_ASSERT_CHECKING=1 PG_CONFIG=$config_path || status=$?
58
- exit $status
59
63
60
64
elif [ " $CC " = " gcc" ]; then
61
65
sudo apt-get -y install -qq cppcheck
@@ -71,22 +75,15 @@ if [ $CHECK_TYPE = "static" ]; then
71
75
cat cppcheck.log
72
76
status=1 # error
73
77
fi
74
-
75
- exit $status
76
78
fi
77
79
78
80
# don't forget to "make clean"
79
81
make clean USE_PGXS=1 PG_CONFIG=$config_path
82
+ echo -en ' travis_fold:end:static_analysis\\r'
83
+ exit $status
80
84
fi
81
85
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'
90
87
91
88
# build extension (using CFLAGS_SL for gcov)
92
89
if [ $CHECK_TYPE == " valgrind" ]; then
101
98
status=$?
102
99
if [ $status -ne 0 ]; then exit $status ; fi
103
100
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
+
104
109
# set permission to write postgres locks
105
110
sudo chown $USER /var/run/postgresql/
106
111
112
+ # create cluster 'test'
113
+ CLUSTER_PATH=$( pwd) /test_cluster
114
+ $initdb_path -D $CLUSTER_PATH -U $USER -A trust
115
+
107
116
# start cluster 'test'
108
117
echo " port = 55435" >> $CLUSTER_PATH /postgresql.conf
109
118
if [ $CHECK_TYPE = " valgrind" ]; then
@@ -122,6 +131,10 @@ PGPORT=55435 PGUSER=$USER PG_CONFIG=$config_path make installcheck USE_PGXS=1 ||
122
131
# stop cluster
123
132
$pg_ctl_path -D $CLUSTER_PATH stop -l postgres.log -w
124
133
134
+ echo -en ' travis_fold:end:run_tests\\r'
135
+
136
+ echo -en ' travis_fold:start:output\\r' && echo ' Check output'
137
+
125
138
# show diff if it exists
126
139
if test -f regression.diffs; then cat regression.diffs; fi
127
140
@@ -143,11 +156,17 @@ for corefile in $(find /tmp/ -name '*.core' 2>/dev/null) ; do
143
156
gdb --batch --quiet -ex " thread apply all bt full" -ex " quit" $binary $corefile
144
157
done
145
158
159
+ echo -en ' travis_fold:end:output\\r'
160
+
161
+ echo -en ' travis_fold:start:coverage\\r' && echo ' Coverage check'
162
+
146
163
# generate *.gcov files
147
164
if [ $CC = " clang" ]; then
148
165
bash <( curl -s https://codecov.io/bash) -x " llvm-cov gcov"
149
166
else
150
167
bash <( curl -s https://codecov.io/bash)
151
168
fi
152
169
170
+ echo -en ' travis_fold:end:coverage\\r'
171
+
153
172
exit $status
0 commit comments