diff options
author | Marius Gripsgard <marius@ubports.com> | 2021-12-28 21:51:22 +0100 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2021-12-31 14:24:25 +0000 |
commit | b8af6bee81f621c936030e914b600f454cde360e (patch) | |
tree | 2b4d810a370e64d7905c5504d09f2e5de33513e8 /tests/auto | |
parent | c1ceee154478a4bdf70e39b3bfb7ae09bce43e90 (diff) | |
download | qbs-b8af6bee81f621c936030e914b600f454cde360e.tar.gz |
tests: Make sure we handle prefix cases where libPath have arch triplet
Example for this case is on debian where libPath is equal to
/usr/lib/[arch]/ this would then end up with a prefix of /usr/lib, this
is wrong as it should be /usr.
This also adds an additional check to see if its starts with /lib as
this might be a correct path on some systems, so we ignore this case.
Change-Id: Idc706892ba70ebb3f212a6938a6285c24e4a75b1
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/blackbox/tst_blackboxqt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/blackbox/tst_blackboxqt.cpp b/tests/auto/blackbox/tst_blackboxqt.cpp index 5d825f8ec..620cd2fa7 100644 --- a/tests/auto/blackbox/tst_blackboxqt.cpp +++ b/tests/auto/blackbox/tst_blackboxqt.cpp @@ -365,7 +365,9 @@ void TestBlackboxQt::pkgconfigQt() lines, [&needle](const auto &line) { return !line.startsWith(needle); }); QCOMPARE(lines.size(), 1); const auto libPath = lines[0].mid(needle.size()); - const auto prefix = QFileInfo(libPath).path(); + auto prefix = QFileInfo(libPath).path(); + if (prefix.endsWith("/lib") && !prefix.startsWith("/lib")) + prefix = QFileInfo(prefix).path(); const auto pkgConfigPath = libPath + "/pkgconfig/"; if (!QFileInfo(pkgConfigPath).exists()) QSKIP("No *.pc files found"); |