summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordac <qt-info@nokia.com>2010-08-10 16:56:18 +1000
committerdac <qt-info@nokia.com>2010-08-10 16:56:18 +1000
commit7cb364c52b17ea1b9a2eedea46226acaaea43379 (patch)
tree2f38419eb293279c976168109e08c548a21eef78
parent275414dd718da59545580a86d0271912bfa40d10 (diff)
Support -o, -xml and -xmllight options for logging output again.
Tidy up logging of backtraces.
-rw-r--r--interpreter/qscriptsystemtest.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/interpreter/qscriptsystemtest.cpp b/interpreter/qscriptsystemtest.cpp
index afee644..99ea621 100644
--- a/interpreter/qscriptsystemtest.cpp
+++ b/interpreter/qscriptsystemtest.cpp
@@ -506,15 +506,21 @@ void QScriptSystemTest::outputBacktrace()
{
QScriptContext *ctx = m_engine->currentContext();
QString bt("Backtrace:");
+ int levels=0;
+
while (ctx) {
QScriptContextInfo ctxInfo(ctx);
QString fn = ctxInfo.fileName();
int ln = ctxInfo.lineNumber();
- if (!fn.isEmpty() && ln != -1)
+ if (!fn.isEmpty() && ln != -1) {
bt += "\n " + fn + "(" + QString::number(ln) + ")";
+ ++levels;
+ }
ctx = ctx->parentContext();
}
- QDebug(QtDebugMsg) << qPrintable(bt);
+
+ if (levels > 1)
+ test_result.addResult( QTestBase::Note, bt );
}
void QScriptSystemTest::skip(QString const &message, QSystemTest::SkipMode mode)
@@ -1208,6 +1214,17 @@ void QScriptSystemTest::processCommandLine( QStringList &args )
if (!arg.compare("-c", Qt::CaseInsensitive)) {
m_checkOnly = true;
it.remove();
+ } else if ( !arg.compare("-o", Qt::CaseInsensitive) ) {
+ it.remove();
+ if (!it.hasNext()) throwFatal(QString("Expected a value after %1").arg(arg));
+ QTestResult::testLog()->setLoggingFile(it.next());
+ it.remove();
+ } else if ( !arg.compare("-xml", Qt::CaseInsensitive) ) {
+ it.remove();
+ QTestResult::testLog()->setLoggingMode(QTestLog::LogXml);
+ } else if ( !arg.compare("-xmllight", Qt::CaseInsensitive) ) {
+ it.remove();
+ QTestResult::testLog()->setLoggingMode(QTestLog::LogXmlLight);
}
}