From ca3adabbf02dae85876bedf28eccea60c79365f4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 24 Mar 2014 14:55:23 +0100 Subject: Introduce abstraction layer for QSKIP. We might want to skip tests in other files as well. Change-Id: Ia2352fdf472b461fb3d9ed6134789b4f56d126e8 Reviewed-by: Joerg Bornemann --- tests/auto/blackbox/blackbox.qbs | 2 +- tests/auto/blackbox/tst_blackbox.cpp | 9 +++------ tests/auto/skip.h | 38 ++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 tests/auto/skip.h (limited to 'tests') diff --git a/tests/auto/blackbox/blackbox.qbs b/tests/auto/blackbox/blackbox.qbs index f7c28939b..eb227df4b 100644 --- a/tests/auto/blackbox/blackbox.qbs +++ b/tests/auto/blackbox/blackbox.qbs @@ -2,6 +2,6 @@ import "../autotest.qbs" as AutoTest AutoTest { testName: "blackbox" - files: ["tst_blackbox.h", "tst_blackbox.cpp"] + files: ["../skip.h", "tst_blackbox.h", "tst_blackbox.cpp", ] cpp.defines: base.concat(['SRCDIR="' + path + '"']) } diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 76f9d6b6a..b28e7ba8d 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -28,6 +28,9 @@ ****************************************************************************/ #include "tst_blackbox.h" + +#include "../skip.h" + #include #include #include @@ -39,12 +42,6 @@ #include #include -#if QT_VERSION >= 0x050000 -#define SKIP_TEST(message) QSKIP(message) -#else -#define SKIP_TEST(message) QSKIP(message, SkipAll) -#endif - using qbs::InstallOptions; using qbs::Internal::HostOsInfo; using qbs::Internal::removeDirectoryWithContents; diff --git a/tests/auto/skip.h b/tests/auto/skip.h new file mode 100644 index 000000000..7da4e6110 --- /dev/null +++ b/tests/auto/skip.h @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ +#ifndef QBS_TEST_SKIP_H +#define QBS_TEST_SKIP_H + +#if QT_VERSION >= 0x050000 +#define SKIP_TEST(message) QSKIP(message) +#else +#define SKIP_TEST(message) QSKIP(message, SkipAll) +#endif + +#endif // Include guard. -- cgit v1.2.3