diff options
author | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-03-07 06:57:32 (GMT) |
---|---|---|
committer | Jedrzej Nowacki <jedrzej.nowacki@nokia.com> | 2011-03-07 09:10:42 (GMT) |
commit | 73e143ac31f1dfedd1b9e8e3502a45eb45e0c1b9 (patch) | |
tree | f93685450d806d5a4c3f2f80232488d639d98e95 | |
parent | abff4d5090c1706c44485bbe3689a0e339c26a9b (diff) | |
download | Qt-73e143ac31f1dfedd1b9e8e3502a45eb45e0c1b9.zip Qt-73e143ac31f1dfedd1b9e8e3502a45eb45e0c1b9.tar.gz Qt-73e143ac31f1dfedd1b9e8e3502a45eb45e0c1b9.tar.bz2 |
Fix a test naming issue.
Project target of a test and test class must match so that all testcase
names can be accurately determined even if a test fails to compile or
run.
-rw-r--r-- | tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp | 36 | ||||
-rw-r--r-- | tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 32 |
2 files changed, 34 insertions, 34 deletions
diff --git a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp index e84ed34..e042dfe 100644 --- a/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp +++ b/tests/auto/qscriptjstestsuite/tst_qscriptjstestsuite.cpp @@ -94,12 +94,12 @@ struct FailureItem QString message; }; -class tst_Suite : public AbstractTestSuite +class tst_QScriptJSTestSuite : public AbstractTestSuite { public: - tst_Suite(); - virtual ~tst_Suite(); + tst_QScriptJSTestSuite(); + virtual ~tst_QScriptJSTestSuite(); protected: virtual void configData(TestConfig::Mode mode, const QStringList &parts); @@ -175,7 +175,7 @@ static QScriptValue qscript_TestCase(QScriptContext *ctx, QScriptEngine *eng) return ret; } -void tst_Suite::runTestFunction(int testIndex) +void tst_QScriptJSTestSuite::runTestFunction(int testIndex) { if (!(testIndex & 1)) { // data @@ -330,7 +330,7 @@ void tst_Suite::runTestFunction(int testIndex) } } -tst_Suite::tst_Suite() +tst_QScriptJSTestSuite::tst_QScriptJSTestSuite() : AbstractTestSuite("tst_QScriptJsTestSuite", QString::fromLatin1("%0/tests").arg(SRCDIR), ":/") @@ -355,11 +355,11 @@ tst_Suite::tst_Suite() finalizeMetaObject(); } -tst_Suite::~tst_Suite() +tst_QScriptJSTestSuite::~tst_QScriptJSTestSuite() { } -void tst_Suite::configData(TestConfig::Mode mode, const QStringList &parts) +void tst_QScriptJSTestSuite::configData(TestConfig::Mode mode, const QStringList &parts) { switch (mode) { case TestConfig::Skip: @@ -372,12 +372,12 @@ void tst_Suite::configData(TestConfig::Mode mode, const QStringList &parts) } } -void tst_Suite::writeSkipConfigFile(QTextStream &stream) +void tst_QScriptJSTestSuite::writeSkipConfigFile(QTextStream &stream) { stream << QString::fromLatin1("# testcase | message") << endl; } -void tst_Suite::writeExpectFailConfigFile(QTextStream &stream) +void tst_QScriptJSTestSuite::writeExpectFailConfigFile(QTextStream &stream) { stream << QString::fromLatin1("# testcase | description | message") << endl; for (int i = 0; i < expectedFailures.size(); ++i) { @@ -393,27 +393,27 @@ void tst_Suite::writeExpectFailConfigFile(QTextStream &stream) } } -void tst_Suite::addExpectedFailure(const QRegExp &path, const QString &description, const QString &message) +void tst_QScriptJSTestSuite::addExpectedFailure(const QRegExp &path, const QString &description, const QString &message) { expectedFailures.append(FailureItem(FailureItem::ExpectFail, path, description, message)); } -void tst_Suite::addExpectedFailure(const QString &fileName, const QString &description, const QString &message) +void tst_QScriptJSTestSuite::addExpectedFailure(const QString &fileName, const QString &description, const QString &message) { expectedFailures.append(FailureItem(FailureItem::ExpectFail, QRegExp(fileName), description, message)); } -void tst_Suite::addSkip(const QRegExp &path, const QString &description, const QString &message) +void tst_QScriptJSTestSuite::addSkip(const QRegExp &path, const QString &description, const QString &message) { expectedFailures.append(FailureItem(FailureItem::Skip, path, description, message)); } -void tst_Suite::addSkip(const QString &fileName, const QString &description, const QString &message) +void tst_QScriptJSTestSuite::addSkip(const QString &fileName, const QString &description, const QString &message) { expectedFailures.append(FailureItem(FailureItem::Skip, QRegExp(fileName), description, message)); } -bool tst_Suite::isExpectedFailure(const QString &fileName, const QString &description, +bool tst_QScriptJSTestSuite::isExpectedFailure(const QString &fileName, const QString &description, QString *message, FailureItem::Action *action) const { for (int i = 0; i < expectedFailures.size(); ++i) { @@ -430,17 +430,17 @@ bool tst_Suite::isExpectedFailure(const QString &fileName, const QString &descri return false; } -void tst_Suite::addFileExclusion(const QString &fileName, const QString &message) +void tst_QScriptJSTestSuite::addFileExclusion(const QString &fileName, const QString &message) { fileExclusions.append(qMakePair(QRegExp(fileName), message)); } -void tst_Suite::addFileExclusion(const QRegExp &rx, const QString &message) +void tst_QScriptJSTestSuite::addFileExclusion(const QRegExp &rx, const QString &message) { fileExclusions.append(qMakePair(rx, message)); } -bool tst_Suite::isExcludedFile(const QString &fileName, QString *message) const +bool tst_QScriptJSTestSuite::isExcludedFile(const QString &fileName, QString *message) const { for (int i = 0; i < fileExclusions.size(); ++i) { if (fileExclusions.at(i).first.indexIn(fileName) != -1) { @@ -452,4 +452,4 @@ bool tst_Suite::isExcludedFile(const QString &fileName, QString *message) const return false; } -QTEST_MAIN(tst_Suite) +QTEST_MAIN(tst_QScriptJSTestSuite) diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index cf86c4d..b35fd06 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -47,11 +47,11 @@ //TESTED_CLASS= //TESTED_FILES= -class tst_Suite : public AbstractTestSuite +class tst_QScriptV8TestSuite : public AbstractTestSuite { public: - tst_Suite(); - virtual ~tst_Suite(); + tst_QScriptV8TestSuite(); + virtual ~tst_QScriptV8TestSuite(); protected: struct ExpectedFailure @@ -106,12 +106,12 @@ static QScriptValue qscript_fail(QScriptContext *ctx, QScriptEngine *eng) return ret; } -void tst_Suite::writeSkipConfigFile(QTextStream &stream) +void tst_QScriptV8TestSuite::writeSkipConfigFile(QTextStream &stream) { stream << QString::fromLatin1("# testcase | message") << endl; } -void tst_Suite::writeExpectFailConfigFile(QTextStream &stream) +void tst_QScriptV8TestSuite::writeExpectFailConfigFile(QTextStream &stream) { stream << QString::fromLatin1("# testcase | actual | expected | message") << endl; for (int i = 0; i < expectedFailures.size(); ++i) { @@ -126,7 +126,7 @@ void tst_Suite::writeExpectFailConfigFile(QTextStream &stream) } } -void tst_Suite::runTestFunction(int testIndex) +void tst_QScriptV8TestSuite::runTestFunction(int testIndex) { QString name = testNames.at(testIndex); QString path = testsDir.absoluteFilePath(name + ".js"); @@ -179,7 +179,7 @@ void tst_Suite::runTestFunction(int testIndex) } } -tst_Suite::tst_Suite() +tst_QScriptV8TestSuite::tst_QScriptV8TestSuite() : AbstractTestSuite("tst_QScriptV8TestSuite", ":/tests", ":/") { @@ -195,11 +195,11 @@ tst_Suite::tst_Suite() finalizeMetaObject(); } -tst_Suite::~tst_Suite() +tst_QScriptV8TestSuite::~tst_QScriptV8TestSuite() { } -void tst_Suite::initTestCase() +void tst_QScriptV8TestSuite::initTestCase() { AbstractTestSuite::initTestCase(); @@ -214,7 +214,7 @@ void tst_Suite::initTestCase() } } -void tst_Suite::configData(TestConfig::Mode mode, const QStringList &parts) +void tst_QScriptV8TestSuite::configData(TestConfig::Mode mode, const QStringList &parts) { switch (mode) { case TestConfig::Skip: @@ -228,13 +228,13 @@ void tst_Suite::configData(TestConfig::Mode mode, const QStringList &parts) } } -void tst_Suite::addExpectedFailure(const QString &testName, const QString &actual, +void tst_QScriptV8TestSuite::addExpectedFailure(const QString &testName, const QString &actual, const QString &expected, const QString &message) { expectedFailures.append(ExpectedFailure(testName, actual, expected, message)); } -bool tst_Suite::isExpectedFailure(const QString &testName, const QString &actual, +bool tst_QScriptV8TestSuite::isExpectedFailure(const QString &testName, const QString &actual, const QString &expected, QString *message) const { for (int i = 0; i < expectedFailures.size(); ++i) { @@ -248,17 +248,17 @@ bool tst_Suite::isExpectedFailure(const QString &testName, const QString &actual return false; } -void tst_Suite::addTestExclusion(const QString &testName, const QString &message) +void tst_QScriptV8TestSuite::addTestExclusion(const QString &testName, const QString &message) { testExclusions.append(qMakePair(QRegExp(testName), message)); } -void tst_Suite::addTestExclusion(const QRegExp &rx, const QString &message) +void tst_QScriptV8TestSuite::addTestExclusion(const QRegExp &rx, const QString &message) { testExclusions.append(qMakePair(rx, message)); } -bool tst_Suite::isExcludedTest(const QString &testName, QString *message) const +bool tst_QScriptV8TestSuite::isExcludedTest(const QString &testName, QString *message) const { for (int i = 0; i < testExclusions.size(); ++i) { if (testExclusions.at(i).first.indexIn(testName) != -1) { @@ -270,4 +270,4 @@ bool tst_Suite::isExcludedTest(const QString &testName, QString *message) const return false; } -QTEST_MAIN(tst_Suite) +QTEST_MAIN(tst_QScriptV8TestSuite) |