summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-06-08 14:52:40 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-06-08 15:48:22 +0000
commit25fb41a58ce20894526573c38e3afa742e86e29d (patch)
treebe3efc8041d4fb0aea7974dc5c871dfe8af1450c
parent861cbef49f0fe439c6498eb77fce12d301c23892 (diff)
QTest::qExtractTestData(): Set permissions of extracted files.
Currently, the files are extracted with read-only permissions. If the data are extracted under a temporary directory, this prevents it from being deleted, causing a leak and test failures (for example, tst_qfileinfo). Change-Id: Idc85f31265af234446ed21d736e9a2b9866dc62d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--src/testlib/qtestcase.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index e3c543671b..9329cf48af 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2839,6 +2839,10 @@ QString QTest::qExtractTestData(const QString &dirName)
qWarning("Failed to copy '%s'.", qPrintable(fileInfo.filePath()));
return QString();
}
+ if (!QFile::setPermissions(destination, QFile::ReadUser | QFile::WriteUser | QFile::ReadGroup)) {
+ qWarning("Failed to set permissions on '%s'.", qPrintable(destination));
+ return QString();
+ }
}
}