summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJo Asplin <jo.asplin@nokia.com>2011-06-30 11:34:36 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-07-26 04:19:46 (GMT)
commit4866d1ba8afbab61e102942d1ea93b81fea053d6 (patch)
treefe31f6c8bddb37c5aa93a5f41d1a3d0e1eb6fc48 /tests
parentdf1bd0745ac4dc45d150840f87e32a57829029cb (diff)
downloadQt-4866d1ba8afbab61e102942d1ea93b81fea053d6.zip
Qt-4866d1ba8afbab61e102942d1ea93b81fea053d6.tar.gz
Qt-4866d1ba8afbab61e102942d1ea93b81fea053d6.tar.bz2
Add test case name and drop parentheses for -datatags option.
For completeness, the -datatags command-line option in QTestLib now prints the test case name at the start of each output line. NOTE: Although the file name is supposed to match the lower-case version of the test case name, this is currently not true in all cases (particularly not under tests/benchmarks). Even if there was a script to enforce this convention, the -datatags option now provides this information in a reliable way. This patch also drops the parentheses after the test function as these are always empty anyway. Data tags for each test function (f() in this case) are printed in four different ways depending on the presence of local and global data tags: Case 1: No tags: tst_MyTestCase f Case 2: Local tags only: tst_MyTestCase f local tag 1 tst_MyTestCase f local tag 2 ... Case 3: Global tags only: tst_MyTestCase f __global__ global tag 1 tst_MyTestCase f __global__ global tag 2 ... Case 4: Local and global tags: tst_MyTestCase f local tag 1 __global__ global tag 1 tst_MyTestCase f local tag 2 __global__ global tag 1 ... tst_MyTestCase f local tag 1 __global__ global tag 2 tst_MyTestCase f local tag 2 __global__ global tag 2 ... ... Change-Id: Id9273039a5d33527c32abf6eb1baef80193fa585 Reviewed-by: Rohan McGovern
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/selftests/expected_printdatatags.txt12
-rw-r--r--tests/auto/selftests/expected_printdatatagswithglobaltags.txt24
-rw-r--r--tests/auto/selftests/printdatatags/tst_printdatatags.cpp14
-rw-r--r--tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp18
4 files changed, 34 insertions, 34 deletions
diff --git a/tests/auto/selftests/expected_printdatatags.txt b/tests/auto/selftests/expected_printdatatags.txt
index 02390dc..ac22f23 100644
--- a/tests/auto/selftests/expected_printdatatags.txt
+++ b/tests/auto/selftests/expected_printdatatags.txt
@@ -1,6 +1,6 @@
-a() data tag a1
-a() data tag a2
-b()
-c() data tag c1
-c() data tag c2
-c() data tag c3
+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/selftests/expected_printdatatagswithglobaltags.txt b/tests/auto/selftests/expected_printdatatagswithglobaltags.txt
index a91e1b8..32feba4 100644
--- a/tests/auto/selftests/expected_printdatatagswithglobaltags.txt
+++ b/tests/auto/selftests/expected_printdatatagswithglobaltags.txt
@@ -1,12 +1,12 @@
-a() data tag a1 __global__ global data tag 1
-a() data tag a2 __global__ global data tag 1
-a() data tag a1 __global__ global data tag 2
-a() data tag a2 __global__ global data tag 2
-b() __global__ global data tag 1
-b() __global__ global data tag 2
-c() data tag c1 __global__ global data tag 1
-c() data tag c2 __global__ global data tag 1
-c() data tag c3 __global__ global data tag 1
-c() data tag c1 __global__ global data tag 2
-c() data tag c2 __global__ global data tag 2
-c() data tag c3 __global__ global data tag 2
+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/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp
index 4b533b3..79f8890 100644
--- a/tests/auto/selftests/printdatatags/tst_printdatatags.cpp
+++ b/tests/auto/selftests/printdatatags/tst_printdatatags.cpp
@@ -42,7 +42,7 @@
#include <QtTest/QtTest>
-class tst_Foo: public QObject
+class tst_MyTestCase: public QObject
{
Q_OBJECT
private slots:
@@ -55,7 +55,7 @@ private slots:
void c() const;
};
-void tst_Foo::a_data() const
+void tst_MyTestCase::a_data() const
{
QTest::addColumn<int>("x");
QTest::addColumn<int>("y");
@@ -64,15 +64,15 @@ void tst_Foo::a_data() const
QTest::newRow("data tag a2") << 1 << 2;
}
-void tst_Foo::a() const
+void tst_MyTestCase::a() const
{
}
-void tst_Foo::b() const
+void tst_MyTestCase::b() const
{
}
-void tst_Foo::c_data() const
+void tst_MyTestCase::c_data() const
{
QTest::addColumn<int>("x");
@@ -81,10 +81,10 @@ void tst_Foo::c_data() const
QTest::newRow("data tag c3") << 1;
}
-void tst_Foo::c() const
+void tst_MyTestCase::c() const
{
}
-QTEST_MAIN(tst_Foo)
+QTEST_MAIN(tst_MyTestCase)
#include "tst_printdatatags.moc"
diff --git a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
index 931dc12..6b0e61b 100644
--- a/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
+++ b/tests/auto/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
@@ -42,7 +42,7 @@
#include <QtTest/QtTest>
-class tst_Foo: public QObject
+class tst_MyTestCase: public QObject
{
Q_OBJECT
private slots:
@@ -58,7 +58,7 @@ private slots:
void c() const;
};
-void tst_Foo::initTestCase_data() const
+void tst_MyTestCase::initTestCase_data() const
{
QTest::addColumn<int>("f");
QTest::addColumn<int>("g");
@@ -67,11 +67,11 @@ void tst_Foo::initTestCase_data() const
QTest::newRow("global data tag 2") << 1 << 2;
}
-void tst_Foo::initTestCase() const
+void tst_MyTestCase::initTestCase() const
{
}
-void tst_Foo::a_data() const
+void tst_MyTestCase::a_data() const
{
QTest::addColumn<int>("x");
QTest::addColumn<int>("y");
@@ -80,15 +80,15 @@ void tst_Foo::a_data() const
QTest::newRow("data tag a2") << 1 << 2;
}
-void tst_Foo::a() const
+void tst_MyTestCase::a() const
{
}
-void tst_Foo::b() const
+void tst_MyTestCase::b() const
{
}
-void tst_Foo::c_data() const
+void tst_MyTestCase::c_data() const
{
QTest::addColumn<int>("x");
@@ -97,10 +97,10 @@ void tst_Foo::c_data() const
QTest::newRow("data tag c3") << 1;
}
-void tst_Foo::c() const
+void tst_MyTestCase::c() const
{
}
-QTEST_MAIN(tst_Foo)
+QTEST_MAIN(tst_MyTestCase)
#include "tst_printdatatagswithglobaltags.moc"