diff options
Diffstat (limited to 'sources/shiboken6/tests/test_generator')
7 files changed, 26 insertions, 144 deletions
diff --git a/sources/shiboken6/tests/test_generator/CMakeLists.txt b/sources/shiboken6/tests/test_generator/CMakeLists.txt index b48ae37da..e1d078894 100644 --- a/sources/shiboken6/tests/test_generator/CMakeLists.txt +++ b/sources/shiboken6/tests/test_generator/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 3.16) +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.18) project(test_generator) set(dummy_generator_SRC dummygenerator.cpp) diff --git a/sources/shiboken6/tests/test_generator/dummygenerator.cpp b/sources/shiboken6/tests/test_generator/dummygenerator.cpp index ef82c11c9..8a5079820 100644 --- a/sources/shiboken6/tests/test_generator/dummygenerator.cpp +++ b/sources/shiboken6/tests/test_generator/dummygenerator.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of Qt for Python. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include <iostream> #include "dummygenerator.h" @@ -36,7 +11,7 @@ using namespace std; QString DummyGenerator::fileNameForClass(const AbstractMetaClass* metaClass) const { - return QString("%1_generated.txt").arg(metaClass->name().toLower()); + return metaClass->name().toLower() + u"_generated.txt"_qs; } void diff --git a/sources/shiboken6/tests/test_generator/dummygenerator.h b/sources/shiboken6/tests/test_generator/dummygenerator.h index e768e7643..d17206809 100644 --- a/sources/shiboken6/tests/test_generator/dummygenerator.h +++ b/sources/shiboken6/tests/test_generator/dummygenerator.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of Qt for Python. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef DUMMYGENERATOR_H #define DUMMYGENERATOR_H diff --git a/sources/shiboken6/tests/test_generator/dummygentest.cpp b/sources/shiboken6/tests/test_generator/dummygentest.cpp index c09cdfb82..d439e3d8c 100644 --- a/sources/shiboken6/tests/test_generator/dummygentest.cpp +++ b/sources/shiboken6/tests/test_generator/dummygentest.cpp @@ -1,37 +1,13 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of Qt for Python. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "dummygentest.h" #include "dummygenerator.h" #include "dummygentestconfig.h" -#include <QTemporaryFile> + +#include <QtCore/QProcess> +#include <QtCore/QTemporaryFile> #include <QtTest/QTest> -#include <QProcess> #define GENERATED_CONTENTS "// Generated code for class: Dummy" @@ -45,14 +21,14 @@ void DummyGenTest::initTestCase() headerFilePath = workDir + "/test_global.h"; typesystemFilePath = workDir + "/test_typesystem.xml"; projectFilePath = workDir + "/dummygentest-project.txt"; - generatedFilePath = QString("%1/dummy/dummy_generated.txt").arg(QDir::tempPath()); + generatedFilePath = QDir::tempPath() + u"/dummy/dummy_generated.txt"_qs; } void DummyGenTest::testCallGenRunnerWithFullPathToDummyGenModule() { QStringList args; args.append("--generator-set=" DUMMYGENERATOR_BINARY_DIR "/dummy_generator" MODULE_EXTENSION); - args.append(QString("--output-directory=%1").arg(QDir::tempPath())); + args.append(u"--output-directory="_qs + QDir::tempPath()); args.append(headerFilePath); args.append(typesystemFilePath); int result = QProcess::execute("generatorrunner", args); @@ -70,7 +46,7 @@ void DummyGenTest::testCallGenRunnerWithNameOfDummyGenModule() { QStringList args; args.append("--generator-set=dummy"); - args.append(QString("--output-directory=%1").arg(QDir::tempPath())); + args.append(u"--output-directory="_qs + QDir::tempPath()); args.append(headerFilePath); args.append(typesystemFilePath); int result = QProcess::execute("generatorrunner", args); @@ -87,7 +63,7 @@ void DummyGenTest::testCallGenRunnerWithNameOfDummyGenModule() void DummyGenTest::testCallDummyGeneratorExecutable() { QStringList args; - args.append(QString("--output-directory=%1").arg(QDir::tempPath())); + args.append(u"--output-directory="_qs + QDir::tempPath()); args.append(headerFilePath); args.append(typesystemFilePath); int result = QProcess::execute(DUMMYGENERATOR_BINARY, args); @@ -103,7 +79,7 @@ void DummyGenTest::testCallDummyGeneratorExecutable() void DummyGenTest::testProjectFileArgumentsReading() { - QStringList args(QString("--project-file=%1/dummygentest-project.txt").arg(workDir)); + QStringList args(u"--project-file="_qs + workDir + u"/dummygentest-project.txt"_qs); int result = QProcess::execute("generatorrunner", args); QCOMPARE(result, 0); diff --git a/sources/shiboken6/tests/test_generator/dummygentest.h b/sources/shiboken6/tests/test_generator/dummygentest.h index 78bae1d52..1b1143b0a 100644 --- a/sources/shiboken6/tests/test_generator/dummygentest.h +++ b/sources/shiboken6/tests/test_generator/dummygentest.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of Qt for Python. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef DUMMYGENTABLETEST_H #define DUMMYGENTABLETEST_H diff --git a/sources/shiboken6/tests/test_generator/main.cpp b/sources/shiboken6/tests/test_generator/main.cpp index f928b4d2c..ba4440b2f 100644 --- a/sources/shiboken6/tests/test_generator/main.cpp +++ b/sources/shiboken6/tests/test_generator/main.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of Qt for Python. -** -** $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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include <QtCore> diff --git a/sources/shiboken6/tests/test_generator/run_test.cmake b/sources/shiboken6/tests/test_generator/run_test.cmake index 34a821d80..37e40b993 100644 --- a/sources/shiboken6/tests/test_generator/run_test.cmake +++ b/sources/shiboken6/tests/test_generator/run_test.cmake @@ -1,3 +1,6 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + # The tests are run through this script due to a limitation # on versions of CMake lesser than 2.8, that prevent setting # environment variables for tests from working. |