diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-12-26 19:02:01 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2018-01-02 19:28:35 +0000 |
commit | eea5b04ab7affdf71c7fe33f5df67b6ffd6851ad (patch) | |
tree | c8a0ca5390e1c6f60feba5f0029e1fc050f22077 /tests | |
parent | ed5dd866cd83c74df5d2d22660b8f1d695218e1b (diff) |
Fix possible false negative in reproducibleBuild autotest
We only need to guarantee that the object file contents are equivalent
if we explicitly requested a reproducible build. This does NOT imply
that a non-reproducible build is *guaranteed* to produce different
object files. This is the case on Fedora systems as uncovered by that
platform's Qbs packagers.
Change-Id: I8e46610f08a8b0c2b59ff84da94e9529c030baba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 0fabf9058..a8b82eabb 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -2005,10 +2005,12 @@ void TestBlackbox::reproducibleBuild() QCOMPARE(runQbs(QbsRunParameters("clean")), 0); QVERIFY(!object.exists()); QCOMPARE(runQbs(params), 0); - QVERIFY(object.open(QIODevice::ReadOnly)); - const QByteArray newContents = object.readAll(); - QCOMPARE(oldContents == newContents, reproducible); - object.close(); + if (reproducible) { + QVERIFY(object.open(QIODevice::ReadOnly)); + const QByteArray newContents = object.readAll(); + QVERIFY(oldContents == newContents); + object.close(); + } QCOMPARE(runQbs(QbsRunParameters("clean")), 0); } |