From 8be35f5e1b1753cf83ce3794daf1e4558c94451f Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Sun, 22 Nov 2015 18:27:18 +1300 Subject: [PATCH] Skip timed tests if $AUTOMATED_TESTING is set --- xapian-core/tests/harness/cputimer.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xapian-core/tests/harness/cputimer.cc b/xapian-core/tests/harness/cputimer.cc index 7136cb934..1296d4724 100644 --- a/xapian-core/tests/harness/cputimer.cc +++ b/xapian-core/tests/harness/cputimer.cc @@ -1,7 +1,7 @@ /** @file cputimer.cc * @brief Measure CPU time. */ -/* Copyright (C) 2009 Olly Betts +/* Copyright (C) 2009,2015 Olly Betts * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -40,6 +40,7 @@ # include #endif +#include #include #include @@ -48,6 +49,11 @@ using namespace std; double CPUTimer::get_current_cputime() const { + static bool skip = (getenv("AUTOMATED_TESTING") != NULL); + if (skip) { + SKIP_TEST("Skipping timed test because $AUTOMATED_TESTING is set"); + } + double t = 0; #ifdef HAVE_GETRUSAGE struct rusage r; -- 2.11.4.GIT