summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/testlib/selftests/expected_printdatatags.txt6
-rw-r--r--tests/auto/testlib/selftests/expected_printdatatagswithglobaltags.txt12
-rw-r--r--tests/auto/testlib/selftests/printdatatags/printdatatags.pro8
-rw-r--r--tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp90
-rw-r--r--tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro8
-rw-r--r--tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp106
-rw-r--r--tests/auto/testlib/selftests/selftests.pro3
-rw-r--r--tests/auto/testlib/selftests/selftests.qrc2
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp15
9 files changed, 249 insertions, 1 deletions
diff --git a/tests/auto/testlib/selftests/expected_printdatatags.txt b/tests/auto/testlib/selftests/expected_printdatatags.txt
new file mode 100644
index 0000000000..ac22f231a4
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_printdatatags.txt
@@ -0,0 +1,6 @@
+tst_MyTestCase a data tag a1
+tst_MyTestCase a data tag a2
+tst_MyTestCase b
+tst_MyTestCase c data tag c1
+tst_MyTestCase c data tag c2
+tst_MyTestCase c data tag c3
diff --git a/tests/auto/testlib/selftests/expected_printdatatagswithglobaltags.txt b/tests/auto/testlib/selftests/expected_printdatatagswithglobaltags.txt
new file mode 100644
index 0000000000..32feba4afb
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_printdatatagswithglobaltags.txt
@@ -0,0 +1,12 @@
+tst_MyTestCase a data tag a1 __global__ global data tag 1
+tst_MyTestCase a data tag a2 __global__ global data tag 1
+tst_MyTestCase a data tag a1 __global__ global data tag 2
+tst_MyTestCase a data tag a2 __global__ global data tag 2
+tst_MyTestCase b __global__ global data tag 1
+tst_MyTestCase b __global__ global data tag 2
+tst_MyTestCase c data tag c1 __global__ global data tag 1
+tst_MyTestCase c data tag c2 __global__ global data tag 1
+tst_MyTestCase c data tag c3 __global__ global data tag 1
+tst_MyTestCase c data tag c1 __global__ global data tag 2
+tst_MyTestCase c data tag c2 __global__ global data tag 2
+tst_MyTestCase c data tag c3 __global__ global data tag 2
diff --git a/tests/auto/testlib/selftests/printdatatags/printdatatags.pro b/tests/auto/testlib/selftests/printdatatags/printdatatags.pro
new file mode 100644
index 0000000000..4db717f4f0
--- /dev/null
+++ b/tests/auto/testlib/selftests/printdatatags/printdatatags.pro
@@ -0,0 +1,8 @@
+CONFIG += testcase
+SOURCES += tst_printdatatags.cpp
+QT = core testlib
+
+mac:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = printdatatags
diff --git a/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp
new file mode 100644
index 0000000000..79f889072f
--- /dev/null
+++ b/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+
+class tst_MyTestCase: public QObject
+{
+ Q_OBJECT
+private slots:
+ void a_data() const;
+ void a() const;
+
+ void b() const;
+
+ void c_data() const;
+ void c() const;
+};
+
+void tst_MyTestCase::a_data() const
+{
+ QTest::addColumn<int>("x");
+ QTest::addColumn<int>("y");
+
+ QTest::newRow("data tag a1 ") << 1 << 2;
+ QTest::newRow("data tag a2") << 1 << 2;
+}
+
+void tst_MyTestCase::a() const
+{
+}
+
+void tst_MyTestCase::b() const
+{
+}
+
+void tst_MyTestCase::c_data() const
+{
+ QTest::addColumn<int>("x");
+
+ QTest::newRow("data tag c1") << 1;
+ QTest::newRow("data tag c2") << 1;
+ QTest::newRow("data tag c3") << 1;
+}
+
+void tst_MyTestCase::c() const
+{
+}
+
+QTEST_MAIN(tst_MyTestCase)
+
+#include "tst_printdatatags.moc"
diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro b/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro
new file mode 100644
index 0000000000..baec7dab06
--- /dev/null
+++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/printdatatagswithglobaltags.pro
@@ -0,0 +1,8 @@
+CONFIG += testcase
+SOURCES += tst_printdatatagswithglobaltags.cpp
+QT = core testlib
+
+mac:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = printdatatagswithglobaltags
diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
new file mode 100644
index 0000000000..6b0e61b7cd
--- /dev/null
+++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** 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, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+
+class tst_MyTestCase: public QObject
+{
+ Q_OBJECT
+private slots:
+ void initTestCase_data() const;
+ void initTestCase() const;
+
+ void a_data() const;
+ void a() const;
+
+ void b() const;
+
+ void c_data() const;
+ void c() const;
+};
+
+void tst_MyTestCase::initTestCase_data() const
+{
+ QTest::addColumn<int>("f");
+ QTest::addColumn<int>("g");
+
+ QTest::newRow("global data tag 1 ") << 1 << 2;
+ QTest::newRow("global data tag 2") << 1 << 2;
+}
+
+void tst_MyTestCase::initTestCase() const
+{
+}
+
+void tst_MyTestCase::a_data() const
+{
+ QTest::addColumn<int>("x");
+ QTest::addColumn<int>("y");
+
+ QTest::newRow("data tag a1 ") << 1 << 2;
+ QTest::newRow("data tag a2") << 1 << 2;
+}
+
+void tst_MyTestCase::a() const
+{
+}
+
+void tst_MyTestCase::b() const
+{
+}
+
+void tst_MyTestCase::c_data() const
+{
+ QTest::addColumn<int>("x");
+
+ QTest::newRow("data tag c1") << 1;
+ QTest::newRow("data tag c2") << 1;
+ QTest::newRow("data tag c3") << 1;
+}
+
+void tst_MyTestCase::c() const
+{
+}
+
+QTEST_MAIN(tst_MyTestCase)
+
+#include "tst_printdatatagswithglobaltags.moc"
diff --git a/tests/auto/testlib/selftests/selftests.pro b/tests/auto/testlib/selftests/selftests.pro
index a43ecdf789..9f772ebdea 100644
--- a/tests/auto/testlib/selftests/selftests.pro
+++ b/tests/auto/testlib/selftests/selftests.pro
@@ -5,7 +5,8 @@ SUBDIRS = subtest test warnings maxwarnings cmptest globaldata skip \
skipinit skipinitdata datetime singleskip assert differentexec \
exceptionthrow qexecstringlist datatable commandlinedata\
benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \
- benchliboptions xunit badxml longstring float
+ benchliboptions xunit badxml longstring float printdatatags \
+ printdatatagswithglobaltags
INSTALLS =
diff --git a/tests/auto/testlib/selftests/selftests.qrc b/tests/auto/testlib/selftests/selftests.qrc
index 10c16ccbf1..2baa49cc56 100644
--- a/tests/auto/testlib/selftests/selftests.qrc
+++ b/tests/auto/testlib/selftests/selftests.qrc
@@ -93,6 +93,8 @@
<file>expected_multiexec.txt</file>
<file>expected_multiexec.xml</file>
<file>expected_multiexec.xunitxml</file>
+ <file>expected_printdatatags.txt</file>
+ <file>expected_printdatatagswithglobaltags.txt</file>
<file>expected_qexecstringlist.txt</file>
<file>expected_singleskip.lightxml</file>
<file>expected_singleskip.txt</file>
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 9a56ce8c1b..7f82b7d899 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -325,6 +325,8 @@ void tst_Selftests::runSubTest_data()
<< "longstring"
<< "maxwarnings"
<< "multiexec"
+ << "printdatatags"
+ << "printdatatagswithglobaltags"
<< "qexecstringlist"
<< "singleskip"
<< "skip"
@@ -370,6 +372,13 @@ void tst_Selftests::runSubTest_data()
else if (subtest == "badxml") {
arguments << "-eventcounter";
}
+ else if (subtest == "printdatatags") {
+ arguments << "-datatags";
+ }
+ else if (subtest == "printdatatagswithglobaltags") {
+ arguments << "-datatags";
+ }
+
// These tests don't work right unless logging plain text to
// standard output, either because they execute multiple test
@@ -388,6 +397,12 @@ void tst_Selftests::runSubTest_data()
if (subtest == "benchliboptions") {
continue;
}
+ if (subtest == "printdatatags") {
+ continue;
+ }
+ if (subtest == "printdatatagswithglobaltags") {
+ continue;
+ }
// `crashes' will not output valid XML on platforms without a crash handler
if (subtest == "crashes") {
continue;