Added valgrind error suppression for the runner process

This commit is contained in:
Snaipe 2015-09-26 17:02:28 +02:00
parent 2b9f14041c
commit c546bcef5c
3 changed files with 18 additions and 1 deletions

View file

@ -51,9 +51,14 @@ endif()
# Setup coveralls
option(CTESTS "Turn on the samples and test" OFF)
option(COVERALLS "Turn on coveralls support" OFF)
option(COVERALLS_UPLOAD "Upload the generated coveralls json" ON)
option(DEV_BUILD "Compile in developer mode" OFF)
option(CTESTS "Turn on the samples and test" ${DEV_BUILD})
if (DEV_BUILD)
set(ENABLE_VALGRIND_ERRORS 1)
endif ()
if (COVERALLS)
include(Coveralls)

View file

@ -3,6 +3,7 @@
#cmakedefine ENABLE_NLS @ENABLE_NLS@
#cmakedefine HAVE_PCRE @HAVE_PCRE@
#cmakedefine ENABLE_VALGRIND_ERRORS @ENABLE_VALGRIND_ERRORS@
# define LOCALEDIR "${LOCALEDIR}"
# define PACKAGE "${PROJECT_NAME}"

View file

@ -158,6 +158,10 @@ struct criterion_test_set *criterion_init(void) {
void run_test_child(struct criterion_test *test,
struct criterion_suite *suite) {
#ifndef ENABLE_VALGRIND_ERRORS
VALGRIND_ENABLE_ERROR_REPORTING;
#endif
if (suite->data && suite->data->timeout != 0 && test->data->timeout == 0)
setup_timeout((uint64_t) (suite->data->timeout * 1e9));
else if (test->data->timeout != 0)
@ -335,6 +339,9 @@ void disable_unmatching(struct criterion_test_set *set) {
struct criterion_test_set *criterion_initialize(void) {
init_i18n();
#ifndef ENABLE_VALGRIND_ERRORS
VALGRIND_DISABLE_ERROR_REPORTING;
#endif
if (RUNNING_ON_VALGRIND) {
criterion_options.no_early_exit = 1;
criterion_options.jobs = 1;
@ -348,6 +355,10 @@ struct criterion_test_set *criterion_initialize(void) {
void criterion_finalize(struct criterion_test_set *set) {
sfree(set);
#ifndef ENABLE_VALGRIND_ERRORS
VALGRIND_ENABLE_ERROR_REPORTING;
#endif
}
static void run_tests_async(struct criterion_test_set *set,