From a539e53eb0acadc6759d87378e27524718db4a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 11 Feb 2020 12:35:52 +0100 Subject: Add 'pass' test to testlib selftests Change-Id: I858cd5e6ef7ad1064166efb7325c62065d46eb27 Reviewed-by: Fawzi Mohamed --- .../auto/testlib/selftests/expected_pass.junitxml | 14 ++++++ .../auto/testlib/selftests/expected_pass.lightxml | 26 ++++++++++ tests/auto/testlib/selftests/expected_pass.tap | 11 +++++ .../auto/testlib/selftests/expected_pass.teamcity | 12 +++++ tests/auto/testlib/selftests/expected_pass.txt | 9 ++++ tests/auto/testlib/selftests/expected_pass.xml | 29 +++++++++++ tests/auto/testlib/selftests/pass/pass.pro | 9 ++++ tests/auto/testlib/selftests/pass/tst_pass.cpp | 56 ++++++++++++++++++++++ tests/auto/testlib/selftests/selftests.pri | 1 + tests/auto/testlib/selftests/tst_selftests.cpp | 5 +- 10 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 tests/auto/testlib/selftests/expected_pass.junitxml create mode 100644 tests/auto/testlib/selftests/expected_pass.lightxml create mode 100644 tests/auto/testlib/selftests/expected_pass.tap create mode 100644 tests/auto/testlib/selftests/expected_pass.teamcity create mode 100644 tests/auto/testlib/selftests/expected_pass.txt create mode 100644 tests/auto/testlib/selftests/expected_pass.xml create mode 100644 tests/auto/testlib/selftests/pass/pass.pro create mode 100644 tests/auto/testlib/selftests/pass/tst_pass.cpp diff --git a/tests/auto/testlib/selftests/expected_pass.junitxml b/tests/auto/testlib/selftests/expected_pass.junitxml new file mode 100644 index 0000000000..b148593bd0 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_pass.junitxml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_pass.lightxml b/tests/auto/testlib/selftests/expected_pass.lightxml new file mode 100644 index 0000000000..4d344e93cf --- /dev/null +++ b/tests/auto/testlib/selftests/expected_pass.lightxml @@ -0,0 +1,26 @@ + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/expected_pass.tap b/tests/auto/testlib/selftests/expected_pass.tap new file mode 100644 index 0000000000..a01755dc25 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_pass.tap @@ -0,0 +1,11 @@ +TAP version 13 +# tst_Pass +ok 1 - initTestCase() +ok 2 - testNumber1() +ok 3 - testNumber2() +ok 4 - testNumber3() +ok 5 - cleanupTestCase() +1..5 +# tests 5 +# pass 5 +# fail 0 diff --git a/tests/auto/testlib/selftests/expected_pass.teamcity b/tests/auto/testlib/selftests/expected_pass.teamcity new file mode 100644 index 0000000000..11dc666fb7 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_pass.teamcity @@ -0,0 +1,12 @@ +##teamcity[testSuiteStarted name='tst_Pass' flowId='tst_Pass'] +##teamcity[testStarted name='initTestCase()' flowId='tst_Pass'] +##teamcity[testFinished name='initTestCase()' flowId='tst_Pass'] +##teamcity[testStarted name='testNumber1()' flowId='tst_Pass'] +##teamcity[testFinished name='testNumber1()' flowId='tst_Pass'] +##teamcity[testStarted name='testNumber2()' flowId='tst_Pass'] +##teamcity[testFinished name='testNumber2()' flowId='tst_Pass'] +##teamcity[testStarted name='testNumber3()' flowId='tst_Pass'] +##teamcity[testFinished name='testNumber3()' flowId='tst_Pass'] +##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Pass'] +##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Pass'] +##teamcity[testSuiteFinished name='tst_Pass' flowId='tst_Pass'] diff --git a/tests/auto/testlib/selftests/expected_pass.txt b/tests/auto/testlib/selftests/expected_pass.txt new file mode 100644 index 0000000000..0d7265f970 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_pass.txt @@ -0,0 +1,9 @@ +********* Start testing of tst_Pass ********* +Config: Using QtTest library +PASS : tst_Pass::initTestCase() +PASS : tst_Pass::testNumber1() +PASS : tst_Pass::testNumber2() +PASS : tst_Pass::testNumber3() +PASS : tst_Pass::cleanupTestCase() +Totals: 5 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms +********* Finished testing of tst_Pass ********* diff --git a/tests/auto/testlib/selftests/expected_pass.xml b/tests/auto/testlib/selftests/expected_pass.xml new file mode 100644 index 0000000000..b221cb5411 --- /dev/null +++ b/tests/auto/testlib/selftests/expected_pass.xml @@ -0,0 +1,29 @@ + + + + @INSERT_QT_VERSION_HERE@ + + @INSERT_QT_VERSION_HERE@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/testlib/selftests/pass/pass.pro b/tests/auto/testlib/selftests/pass/pass.pro new file mode 100644 index 0000000000..dd00a1c744 --- /dev/null +++ b/tests/auto/testlib/selftests/pass/pass.pro @@ -0,0 +1,9 @@ +SOURCES += tst_pass.cpp +QT = core testlib + +macos:CONFIG -= app_bundle +CONFIG -= debug_and_release_target + +TARGET = pass + +include($$QT_SOURCE_TREE/src/testlib/selfcover.pri) diff --git a/tests/auto/testlib/selftests/pass/tst_pass.cpp b/tests/auto/testlib/selftests/pass/tst_pass.cpp new file mode 100644 index 0000000000..6fa5f6a209 --- /dev/null +++ b/tests/auto/testlib/selftests/pass/tst_pass.cpp @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $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 +#include + +class tst_Pass: public QObject +{ + Q_OBJECT + +private slots: + void testNumber1() const; + void testNumber2() const; + void testNumber3() const; +}; + +void tst_Pass::testNumber1() const +{ +} + +void tst_Pass::testNumber2() const +{ +} + +void tst_Pass::testNumber3() const +{ +} + +QTEST_MAIN(tst_Pass) + +#include "tst_pass.moc" diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri index 2cad0b7e17..b124b21981 100644 --- a/tests/auto/testlib/selftests/selftests.pri +++ b/tests/auto/testlib/selftests/selftests.pri @@ -31,6 +31,7 @@ SUBPROGRAMS = \ longstring \ maxwarnings \ multiexec \ + pass \ pairdiagnostics \ printdatatags \ printdatatagswithglobaltags \ diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index be64752ceb..cab6589984 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -422,9 +422,9 @@ void tst_Selftests::initTestCase() { QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString())); //Detect the location of the sub programs - QString subProgram = QLatin1String("float/float"); + QString subProgram = QLatin1String("pass/pass"); #if defined(Q_OS_WIN) - subProgram = QLatin1String("float/float.exe"); + subProgram = QLatin1String("pass/pass.exe"); #endif QString testdataDir = QFINDTESTDATA(subProgram); if (testdataDir.lastIndexOf(subProgram) > 0) @@ -487,6 +487,7 @@ void tst_Selftests::runSubTest_data() << "longstring" << "maxwarnings" << "multiexec" + << "pass" << "pairdiagnostics" << "printdatatags" << "printdatatagswithglobaltags" -- cgit v1.2.3