}
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) {
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
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())
// Run the initTestCase function.
qtest_results.functionName = "initTestCase"
- qtest_results.functionType = TestResult.InitFunc
var runTests = true
if (!qtest_runInternal("initTestCase"))
runTests = false
}
qtest_results.functionName = prop
if (datafunc in testCase) {
- qtest_results.functionType = TestResult.DataFunc
if (qtest_runInternal(datafunc)) {
var table = qtest_testCaseResult
var haveData = false
// 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.
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);
results.finishTestData();
results.finishTestFunction();
results.setFunctionName(QString());
- results.setFunctionType(QuickTestResult::NoWhere);
results.stopLogging();
}
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)
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
{
QString functionName() const;
void setFunctionName(const QString &name);
- FunctionType functionType() const;
- void setFunctionType(FunctionType type);
-
QString dataTag() const;
void setDataTag(const QString &tag);
void programNameChanged();
void testCaseNameChanged();
void functionNameChanged();
- void functionTypeChanged();
void dataTagChanged();
void skippedChanged();