diff options
author | Richard Weickelt <richard@weickelt.de> | 2020-07-14 09:42:44 +0200 |
---|---|---|
committer | Richard Weickelt <richard@weickelt.de> | 2020-08-13 19:48:28 +0000 |
commit | f456797d9b3fa5826a31631714a1c605de006371 (patch) | |
tree | c0b5acfdc4453e7c5d0265a03306fb3c74378c50 /tests/auto/blackbox/testdata/path-probe | |
parent | 50218dd96bad519b640ea122ac8cf50817750a99 (diff) |
Do not rely on PathProbe returning relative paths
This testcase uses relative paths both as input properties to PathProbe
and as expected results (rhs). The obtained output properties (lhs) are
relative paths, too and as such, a simple string comparison is performed
to verify the results. While this currently works, it is not correct to
do so.
PathProbe features input and output properties of pathList type and
thus, when reading these properties, returned values should always be
absolute file paths. It is a known problem that path properties in
probes are not absolutified, which will be fixed when porting to
QJSEngine. Thus, we need to absolutify the expected values when
evaluating the results.
In order to remain compatible with the current implementation, we need
to do the absolutification on both sides.
Change-Id: I13c7655f509179f3778c736e08fbd1bd264a63c4
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'tests/auto/blackbox/testdata/path-probe')
-rw-r--r-- | tests/auto/blackbox/testdata/path-probe/BaseApp.qbs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs b/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs index 93172579f..46f89cb60 100644 --- a/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs +++ b/tests/auto/blackbox/testdata/path-probe/BaseApp.qbs @@ -62,7 +62,7 @@ CppApplication { if (Array.isArray(lhs[i]) && Array.isArray(rhs[i])) { if (!compareArrays(lhs[i], rhs[i])) return false; - } else if (lhs[i] !== rhs[i]) { + } else if (FileInfo.resolvePath(path, lhs[i]) !== FileInfo.resolvePath(path, rhs[i])) { return false; } } @@ -117,7 +117,7 @@ CppApplication { + ", expected = " + expectedFileName; } var expectedPath = probe.allResults[0].path; - if (probe.path !== expectedPath) { + if (FileInfo.resolvePath(path, probe.path) !== FileInfo.resolvePath(path, expectedPath)) { throw "Invalid path: actual = " + probe.path + ", expected = " + expectedPath; } |