Improve cleanup of selftests

The selftest was only attempting to delete the output file at the end of
the entire test run.  This file should actually be deleted after each
subtest to ensure that it does not cause confusing errors if the next
subtest fails to overwrite the output file.

Change-Id: Ia3827926f71a697c6108de3f2b08c969f761d978
Reviewed-on: http://codereview.qt-project.org/5051
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
bb10
Jason McDonald 2011-09-16 15:03:44 +10:00 committed by Qt by Nokia
parent 89c7db5159
commit 8a12d5fbf0
1 changed files with 3 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class tst_Selftests: public QObject
private slots:
void runSubTest_data();
void runSubTest();
void cleanupTestCase();
void cleanup();
private:
void doRunSubTest(QString const& subdir, QString const& logger, QStringList const& arguments );
@ -609,8 +609,9 @@ BenchmarkResult BenchmarkResult::parse(QString const& line, QString* error)
return out;
}
void tst_Selftests::cleanupTestCase()
void tst_Selftests::cleanup()
{
// Remove the test output file
QFile::remove("test_output");
}