Skip to content

Commit 75d3c57

Browse files
authored
Merge pull request #282 from libtom/restrict-v-algrind
Restrict running Valgrind
2 parents e11f70f + 2555884 commit 75d3c57

File tree

3 files changed

+68
-51
lines changed

3 files changed

+68
-51
lines changed

.travis.yml

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,51 @@ matrix:
6767
packages:
6868
- astyle
6969

70-
# GCC for the 32-bit architecture (no valgrind yet)
70+
# Run always with valgrind (no sanitizer, but debug info)
71+
- env: COMPILE_DEBUG=1 BUILDOPTIONS='--with-cc=gcc-4.9 --with-m64 --with-valgrind'
72+
addons:
73+
apt:
74+
packages:
75+
- gcc-4.9
76+
77+
# GCC for the 32-bit architecture (no valgrind)
7178
- env: BUILDOPTIONS='--with-cc=gcc-5 --with-m32'
7279
addons:
7380
apt:
7481
packages:
7582
- libc6-dev-i386
7683
- gcc-multilib
7784

78-
# clang for the 32-bit architecture (no valgrind yet)
85+
# clang for the 32-bit architecture (no valgrind)
7986
- env: BUILDOPTIONS='--with-cc=clang-7 --with-m32'
8087
addons:
8188
apt:
8289
packages:
8390
- libc6-dev-i386
8491
- gcc-multilib
8592

93+
# Test "autotuning", the automatic evaluation and setting of the Toom-Cook cut-offs.
94+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_8BIT --with-travis-valgrind --make-option=tune'
95+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_16BIT --with-travis-valgrind --make-option=tune'
96+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_32BIT --with-travis-valgrind --make-option=tune'
97+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --with-travis-valgrind --make-option=tune'
98+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_8BIT --with-travis-valgrind --make-option=tune'
99+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_16BIT --with-travis-valgrind --make-option=tune'
100+
#- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_32BIT --with-travis-valgrind --make-option=tune'
101+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --with-travis-valgrind --make-option=tune'
102+
103+
# GCC for the x86-64 architecture testing against a different Bigint-implementation
104+
# with 333333 different inputs.
105+
#- env: BUILDOPTIONS='--with-cc=gcc-5 --test-vs-mtest=333333 --with-travis-valgrind'
106+
# ... and a better random source.
107+
- env: BUILDOPTIONS='--with-cc=gcc-5 --test-vs-mtest=333333 --mtest-real-rand --with-travis-valgrind'
108+
109+
# clang for the x86-64 architecture testing against a different Bigint-implementation
110+
# with 333333 different inputs
111+
- env: BUILDOPTIONS='--with-cc=clang-7 --test-vs-mtest=333333 --with-travis-valgrind'
112+
# ... and a better random source.
113+
#- env: BUILDOPTIONS='--with-cc=clang-7 --test-vs-mtest=333333 --mtest-real-rand --with-travis-valgrind'
114+
86115
# GCC for the x64_32 architecture (32-bit longs and 32-bit pointers)
87116
# TODO: Probably not possible to run anything in x32 in Travis
88117
# but needs to be checked to be sure.
@@ -94,37 +123,32 @@ matrix:
94123
- gcc-multilib
95124

96125
# GCC for the x86-64 architecture (64-bit longs and 64-bit pointers)
97-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --with-m64 --with-valgrind'
98-
- env: BUILDOPTIONS='--with-cc=gcc-4.7 --with-m64 --with-valgrind'
126+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --with-m64 --with-travis-valgrind'
127+
- env: BUILDOPTIONS='--with-cc=gcc-4.7 --with-m64 --with-travis-valgrind'
99128
addons:
100129
apt:
101130
packages:
102131
- gcc-4.7
103-
- env: BUILDOPTIONS='--with-cc=gcc-4.8 --with-m64 --with-valgrind'
132+
- env: BUILDOPTIONS='--with-cc=gcc-4.8 --with-m64 --with-travis-valgrind'
104133
addons:
105134
apt:
106135
packages:
107136
- gcc-4.8
108-
- env: BUILDOPTIONS='--with-cc=gcc-4.9 --with-m64 --with-valgrind'
109-
addons:
110-
apt:
111-
packages:
112-
- gcc-4.9
113137

114138
# clang for x86-64 architecture (64-bit longs and 64-bit pointers)
115-
- env: SANITIZER=1 CONV_WARNINGS=strict BUILDOPTIONS='--with-cc=clang-7 --with-m64 --with-valgrind'
116-
- env: SANITIZER=1 CONV_WARNINGS=relaxed BUILDOPTIONS='--with-cc=clang-7 --with-m64 --with-valgrind'
117-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-6.0 --with-m64 --with-valgrind'
139+
- env: SANITIZER=1 CONV_WARNINGS=relaxed BUILDOPTIONS='--with-cc=clang-7 --with-m64 --with-travis-valgrind'
140+
- env: SANITIZER=1 CONV_WARNINGS=strict BUILDOPTIONS='--with-cc=clang-7 --with-m64 --with-travis-valgrind'
141+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-6.0 --with-m64 --with-travis-valgrind'
118142
addons:
119143
apt:
120144
packages:
121145
- clang-6.0
122-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-5.0 --with-m64 --with-valgrind'
146+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-5.0 --with-m64 --with-travis-valgrind'
123147
addons:
124148
apt:
125149
packages:
126150
- clang-5.0
127-
- env: BUILDOPTIONS='--with-cc=clang-4.0 --with-m64 --with-valgrind'
151+
- env: BUILDOPTIONS='--with-cc=clang-4.0 --with-m64 --with-travis-valgrind'
128152
addons:
129153
apt:
130154
packages:
@@ -133,35 +157,14 @@ matrix:
133157
# GCC for the x86-64 architecture with restricted limb sizes
134158
# formerly started with the option "--with-low-mp" to testme.sh
135159
# but testing all three in one run took to long and timed out.
136-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_8BIT --with-valgrind'
137-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_16BIT --with-valgrind'
138-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_32BIT --with-valgrind'
160+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_8BIT --with-travis-valgrind'
161+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_16BIT --with-travis-valgrind'
162+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_32BIT --with-travis-valgrind'
139163

140164
# clang for the x86-64 architecture with restricted limb sizes
141-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_8BIT --with-valgrind'
142-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_16BIT --with-valgrind'
143-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_32BIT --with-valgrind'
144-
145-
# Test "autotuning", the automatic evaluation and setting of the Toom-Cook cut-offs.
146-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_8BIT --with-valgrind --make-option=tune'
147-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_16BIT --with-valgrind --make-option=tune'
148-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --cflags=-DMP_32BIT --with-valgrind --make-option=tune'
149-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=gcc-5 --with-valgrind --make-option=tune'
150-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_8BIT --with-valgrind --make-option=tune'
151-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_16BIT --with-valgrind --make-option=tune'
152-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_32BIT --with-valgrind --make-option=tune'
153-
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --with-valgrind --make-option=tune'
154-
155-
# GCC for the x86-64 architecture testing against a different Bigint-implementation
156-
# with 333333 different inputs.
157-
- env: BUILDOPTIONS='--with-cc=gcc-5 --test-vs-mtest=333333 --with-valgrind'
158-
- env: BUILDOPTIONS='--with-cc=clang-7 --test-vs-mtest=333333 --with-valgrind'
159-
160-
# clang for the x86-64 architecture testing against a different Bigint-implementation
161-
# with a better random source.
162-
- env: BUILDOPTIONS='--with-cc=gcc-5 --test-vs-mtest=333333 --mtest-real-rand --with-valgrind'
163-
- env: BUILDOPTIONS='--with-cc=clang-7 --test-vs-mtest=333333 --mtest-real-rand --with-valgrind'
164-
165+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_8BIT --with-travis-valgrind'
166+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_16BIT --with-travis-valgrind'
167+
- env: SANITIZER=1 BUILDOPTIONS='--with-cc=clang-7 --cflags=-DMP_32BIT --with-travis-valgrind'
165168

166169
# Notifications go to
167170
# An email address is also possible.

makefile_include.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ endif
7171
ifdef COMPILE_DEBUG
7272
#debug
7373
CFLAGS += -g3
74-
else
74+
endif
7575

7676
ifdef COMPILE_SIZE
7777
#for size
@@ -87,7 +87,6 @@ CFLAGS += -fomit-frame-pointer
8787
endif
8888

8989
endif # COMPILE_SIZE
90-
endif # COMPILE_DEBUG
9190

9291
ifneq ($(findstring clang,$(CC)),)
9392
CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header

testme.sh

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ _help()
6161
echo " --with-valgrind"
6262
echo " --with-valgrind=* Run in valgrind (slow!)."
6363
echo
64-
echo " --valgrind-options Additional Valgrind options"
65-
echo " Some of the options like e.g.:"
66-
echo " --track-origins=yes add a lot of extra"
67-
echo " runtime and may trigger the 30 minutes"
68-
echo " timeout."
64+
echo " --with-travis-valgrind Run with valgrind on Travis on specific branches."
65+
echo
66+
echo " --valgrind-options Additional Valgrind options"
67+
echo " Some of the options like e.g.:"
68+
echo " --track-origins=yes add a lot of extra"
69+
echo " runtime and may trigger the 30 minutes"
70+
echo " timeout."
6971
echo
7072
echo "Godmode:"
7173
echo
@@ -126,7 +128,7 @@ _runtest()
126128
# get switched off without some effort, so we just let it run twice for testing purposes
127129
_make "$1" "$2" ""
128130
echo -e "\rRun autotune $1 $2"
129-
$_timeout ./etc/tune_it.sh > test_${suffix}.log || _die "running autotune" $?
131+
$_timeout $TUNE_CMD > ../test_${suffix}.log || _die "running autotune" $?
130132
else
131133
_make "$1" "$2" "test_standalone"
132134
echo -e "\rRun test $1 $2"
@@ -152,7 +154,7 @@ echo "autotune branch"
152154
# The shell used for /bin/sh is DASH 0.5.7-4ubuntu1 on the author's machine which fails valgrind, so
153155
# we just run on instance of etc/tune with the same options as in etc/tune_it.sh
154156
echo -e "\rRun etc/tune $1 $2 once inside valgrind"
155-
$_timeout $VALGRIND_BIN $VALGRIND_OPTS ./etc/tune -t -r 10 -L 3 > test_${suffix}.log || _die "running etc/tune" $?
157+
$_timeout $VALGRIND_BIN $VALGRIND_OPTS $TUNE_CMD > test_${suffix}.log || _die "running etc/tune" $?
156158
else
157159
_make "$1" "$2" "test_standalone"
158160
echo -e "\rRun test $1 $2 inside valgrind"
@@ -193,6 +195,7 @@ VALGRIND_OPTS=" --leak-check=full --show-leak-kinds=all --error-exitcode=1 "
193195
#VALGRIND_OPTS=""
194196
VALGRIND_BIN=""
195197
CHECK_FORMAT=""
198+
TUNE_CMD="./etc/tune -t -r 10 -L 3"
196199

197200
alive_pid=0
198201

@@ -232,6 +235,18 @@ do
232235
fi
233236
start_alive_printing
234237
;;
238+
--with-travis-valgrind*)
239+
if [[ ("$TRAVIS_BRANCH" == "develop" && "$TRAVIS_PULL_REQUEST" == "false") || "$TRAVIS_BRANCH" == *"valgrind"* || "$TRAVIS_COMMIT_MESSAGE" == *"valgrind"* ]]
240+
then
241+
if [[ ${1#*d} != "" ]]
242+
then
243+
VALGRIND_BIN="${1#*=}"
244+
else
245+
VALGRIND_BIN="valgrind"
246+
fi
247+
start_alive_printing
248+
fi
249+
;;
235250
--make-option=*)
236251
MAKE_OPTIONS="$MAKE_OPTIONS ${1#*=}"
237252
;;

0 commit comments

Comments
 (0)