From 8a12d5fbf0ad0f34695a4067bb39017b0867f364 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 16 Sep 2011 15:03:44 +1000 Subject: 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 Reviewed-by: Rohan McGovern --- tests/auto/testlib/selftests/tst_selftests.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/auto/testlib') diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index 28d75f9591..80e8414b89 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -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"); } -- cgit v1.2.3