From ac0048cc01051af0c7d272e55b6f110ed23ca4f7 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 4 Oct 2016 01:19:34 +0100 Subject: [PATCH] Make ZNC faster in the integration test. This is not appropriate for normal usage. --- src/Modules.cpp | 6 ++++++ test/integration/main.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/Modules.cpp b/src/Modules.cpp index 0adfbd30..f1bd5e6f 100644 --- a/src/Modules.cpp +++ b/src/Modules.cpp @@ -104,6 +104,12 @@ CTimer::CTimer(CModule* pModule, unsigned int uInterval, unsigned int uCycles, : CCron(), m_pModule(pModule), m_sDescription(sDescription) { SetName(sLabel); + // Make integration test faster + char* szDebugTimer = getenv("ZNC_DEBUG_TIMER"); + if (szDebugTimer && *szDebugTimer == '1') { + uInterval = std::max(1u, uInterval / 4u); + } + if (uCycles) { StartMaxCycles(uInterval, uCycles); } else { diff --git a/test/integration/main.cpp b/test/integration/main.cpp index 2b484395..373786e1 100644 --- a/test/integration/main.cpp +++ b/test/integration/main.cpp @@ -128,6 +128,7 @@ class Process : public IO { std::function setup = [](QProcess*) {}) : IO(&m_proc, true) { auto env = QProcessEnvironment::systemEnvironment(); + env.insert("ZNC_DEBUG_TIMER", "1"); // Default exit codes of sanitizers upon error: // ASAN - 1 // LSAN - 23 (part of ASAN, but uses a different value)