diff options
Diffstat (limited to 'tests')
6 files changed, 87 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/file.cpp b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/file.cpp new file mode 100644 index 000000000..1d9f38c57 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/file.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/main.cpp b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/main.cpp new file mode 100644 index 000000000..e20edd490 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/main.cpp @@ -0,0 +1,33 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "pch.h" + +int main() +{ +} diff --git a/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/pch.h b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/pch.h new file mode 100644 index 000000000..59d72018e --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/pch.h @@ -0,0 +1,30 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qbs. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <algorithm> +#include <memory> diff --git a/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/precompiled-headers-and-redefine.qbs b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/precompiled-headers-and-redefine.qbs new file mode 100644 index 000000000..55b53a7af --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiled-headers-and-redefine/precompiled-headers-and-redefine.qbs @@ -0,0 +1,16 @@ +CppApplication { + name: "MyApp" + consoleApplication: true + Group { + files: ["pch.h"] + fileTags: ["cpp_pch_src"] + } + Group { + files: ["file.cpp"] + cpp.defines: ["MYDEF=1"] + cpp.cxxFlags: base.concat(qbs.toolchain.contains("clang-cl") ? ["-Wno-clang-cl-pch"] : []) + } + cpp.treatWarningsAsErrors: true + + files: ["main.cpp"] +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 5747b52b1..99e1142f8 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2865,6 +2865,12 @@ void TestBlackbox::precompiledAndPrefixHeaders() QCOMPARE(runQbs(), 0); } +void TestBlackbox::precompiledHeaderAndRedefine() +{ + QDir::setCurrent(testDataDir + "/precompiled-headers-and-redefine"); + QCOMPARE(runQbs(), 0); +} + void TestBlackbox::preventFloatingPointValues() { QDir::setCurrent(testDataDir + "/prevent-floating-point-values"); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index f7f1c9a29..5b3adcbe2 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -212,6 +212,7 @@ private slots: void pkgConfigProbeSysroot(); void pluginDependency(); void precompiledAndPrefixHeaders(); + void precompiledHeaderAndRedefine(); void preventFloatingPointValues(); void probeChangeTracking(); void probeProperties(); |