Remove code related to test location.

Testlib no longer does anything with the test location and neither do
any of Qt's tests, so this code is no longer needed.

Change-Id: Ic370b6b741382a90454c893bffcab4a7328a2f9e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
This commit is contained in:
Jason McDonald 2012-02-07 12:42:05 +10:00 committed by Qt by Nokia
parent 5b76b0de48
commit 3233e8052d
4 changed files with 1 additions and 40 deletions

View File

@ -481,16 +481,12 @@ Item {
}
function qtest_runFunction(prop, arg) {
qtest_results.functionType = TestResult.InitFunc
qtest_runInternal("init")
if (!qtest_results.skipped) {
qtest_results.functionType = TestResult.Func
qtest_runInternal(prop, arg)
qtest_results.finishTestData()
qtest_results.functionType = TestResult.CleanupFunc
qtest_runInternal("cleanup")
}
qtest_results.functionType = TestResult.NoWhere
}
function qtest_runBenchmarkFunction(prop, arg) {
@ -499,13 +495,11 @@ Item {
qtest_results.beginDataRun()
do {
// Run the initialization function.
qtest_results.functionType = TestResult.InitFunc
qtest_runInternal("init")
if (qtest_results.skipped)
break
// Execute the benchmark function.
qtest_results.functionType = TestResult.Func
if (prop.indexOf("benchmark_once_") != 0)
qtest_results.startBenchmark(TestResult.RepeatUntilValidMeasurement, qtest_results.dataTag)
else
@ -520,9 +514,7 @@ Item {
qtest_results.stopBenchmark()
// Run the cleanup function.
qtest_results.functionType = TestResult.CleanupFunc
qtest_runInternal("cleanup")
qtest_results.functionType = TestResult.NoWhere
} while (!qtest_results.measurementAccepted())
qtest_results.endDataRun()
} while (qtest_results.needsMoreMeasurements())
@ -571,7 +563,6 @@ Item {
// Run the initTestCase function.
qtest_results.functionName = "initTestCase"
qtest_results.functionType = TestResult.InitFunc
var runTests = true
if (!qtest_runInternal("initTestCase"))
runTests = false
@ -603,7 +594,6 @@ Item {
}
qtest_results.functionName = prop
if (datafunc in testCase) {
qtest_results.functionType = TestResult.DataFunc
if (qtest_runInternal(datafunc)) {
var table = qtest_testCaseResult
var haveData = false
@ -637,7 +627,6 @@ Item {
// Run the cleanupTestCase function.
qtest_results.skipped = false
qtest_results.functionName = "cleanupTestCase"
qtest_results.functionType = TestResult.CleanupFunc
qtest_runInternal("cleanupTestCase")
// Complain about missing functions that we were supposed to run.

View File

@ -142,7 +142,6 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View &
results.setTestCaseName(fi.baseName());
results.startLogging();
results.setFunctionName(QLatin1String("compile"));
results.setFunctionType(QuickTestResult::Func);
// Verbose warning output of all messages and relevant parameters
QString message;
QTextStream str(&message);
@ -176,7 +175,6 @@ template <class View> void handleCompileErrors(const QFileInfo &fi, const View &
results.finishTestData();
results.finishTestFunction();
results.setFunctionName(QString());
results.setFunctionType(QuickTestResult::NoWhere);
results.stopLogging();
}

View File

@ -163,17 +163,6 @@ void QuickTestResult::setFunctionName(const QString &name)
emit functionNameChanged();
}
QuickTestResult::FunctionType QuickTestResult::functionType() const
{
return FunctionType(QTestResult::currentTestLocation());
}
void QuickTestResult::setFunctionType(FunctionType type)
{
QTestResult::setCurrentTestLocation(QTestResult::TestLocation(type));
emit functionTypeChanged();
}
/*!
\qmlproperty string TestResult::dataTag

View File

@ -56,10 +56,9 @@ class QuickTestResultPrivate;
class Q_QUICK_TEST_EXPORT QuickTestResult : public QObject
{
Q_OBJECT
Q_ENUMS(FunctionType RunMode)
Q_ENUMS(RunMode)
Q_PROPERTY(QString testCaseName READ testCaseName WRITE setTestCaseName NOTIFY testCaseNameChanged)
Q_PROPERTY(QString functionName READ functionName WRITE setFunctionName NOTIFY functionNameChanged)
Q_PROPERTY(FunctionType functionType READ functionType WRITE setFunctionType NOTIFY functionTypeChanged)
Q_PROPERTY(QString dataTag READ dataTag WRITE setDataTag NOTIFY dataTagChanged)
Q_PROPERTY(bool failed READ isFailed)
Q_PROPERTY(bool dataFailed READ isDataFailed)
@ -72,16 +71,6 @@ public:
QuickTestResult(QObject *parent = 0);
~QuickTestResult();
// Values must match QTestResult::TestLocation.
enum FunctionType
{
NoWhere = 0,
DataFunc = 1,
InitFunc = 2,
Func = 3,
CleanupFunc = 4
};
// Values must match QBenchmarkIterationController::RunMode.
enum RunMode
{
@ -95,9 +84,6 @@ public:
QString functionName() const;
void setFunctionName(const QString &name);
FunctionType functionType() const;
void setFunctionType(FunctionType type);
QString dataTag() const;
void setDataTag(const QString &tag);
@ -164,7 +150,6 @@ Q_SIGNALS:
void programNameChanged();
void testCaseNameChanged();
void functionNameChanged();
void functionTypeChanged();
void dataTagChanged();
void skippedChanged();