aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/shared.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-10-17 16:22:52 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-11-10 10:48:11 +0100
commit3957fb612ae250671df02af67da2123ff65af232 (patch)
tree9e271070b06c389559ffce6d2d0d243e2a6e5f5c /tests/auto/shared.h
parent9f6b297ca49a5eb376d11d130b240a8c8629e250 (diff)
Use a hashing function to construct output artfact file paths.
Modules like cpp need a way to construct unique locations for output artifacts, but the current approach of duplicating the path to the input file in the build directory can lead to excessively long file paths that hit the limit on Windows. So let's hash the path to the input file instead. Change-Id: I47dcd242d0ee90c377f2a6df8e270bbefbaf082f Reviewed-by: Thomas Epting <thomas.epting@stryker.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'tests/auto/shared.h')
-rw-r--r--tests/auto/shared.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/shared.h b/tests/auto/shared.h
index 67ea19128..193327e21 100644
--- a/tests/auto/shared.h
+++ b/tests/auto/shared.h
@@ -119,4 +119,9 @@ inline QString objectFileName(const QString &baseName, const QString &profileNam
return baseName + '.' + suffix;
}
+inline QString inputDirHash(const QString &dir)
+{
+ return QCryptographicHash::hash(dir.toLatin1(), QCryptographicHash::Sha1).toHex().left(16);
+}
+
#endif // Include guard.