1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

tests: New test run envvar to run gpg under valgrind.

--

Take care: Running under valgrind takes loooong and in some case you
may run into an valgrind internal error.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-09-04 11:29:32 +02:00
parent 43bbc25b0f
commit b7f56ba5e3
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 14 additions and 1 deletions

View File

@ -25,6 +25,9 @@ spawned programs to their standard error stream, verbose=2 to see what
programs are executed, or verbose=3 to see even more program output programs are executed, or verbose=3 to see even more program output
and exit codes. and exit codes.
If you want to run gpg under valgrind add with_valgrind=1.
** Inspecting the test environment ** Inspecting the test environment
To inspect the environment in which tests are running, or to quickly To inspect the environment in which tests are running, or to quickly

View File

@ -123,6 +123,7 @@
(define bin-prefix (getenv "BIN_PREFIX")) (define bin-prefix (getenv "BIN_PREFIX"))
(define installed? (not (string=? "" bin-prefix))) (define installed? (not (string=? "" bin-prefix)))
(define with-valgrind? (not (string=? (getenv "with_valgrind") "")))
(define (tool-hardcoded which) (define (tool-hardcoded which)
(let ((t (assoc which tools))) (let ((t (assoc which tools)))
@ -138,7 +139,8 @@
;; (set! gpg `(,@valgrind ,@gpg)) ;; (set! gpg `(,@valgrind ,@gpg))
;; ;;
(define valgrind (define valgrind
'("/usr/bin/valgrind" --leak-check=full --error-exitcode=154)) '("/usr/bin/valgrind" -q --leak-check=no --track-origins=yes
--error-exitcode=154 --exit-on-first-error=yes))
(unless installed? (unless installed?
(setenv "GNUPG_BUILDDIR" (getenv "objdir") #t)) (setenv "GNUPG_BUILDDIR" (getenv "objdir") #t))
@ -496,4 +498,12 @@
"but got" trust)))) "but got" trust))))
;;
;; Enable checking with valgrind if the envvar "with_valgrind" is set
;;
(when with-valgrind?
(set! gpg `(,@valgrind ,@gpg)))
;; end ;; end