summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
diff options
context:
space:
mode:
authorJanne Juntunen <janne.juntunen@qt.io>2021-11-03 13:04:07 +0200
committerJanne Juntunen <janne.juntunen@qt.io>2021-11-30 14:37:52 +0200
commit2bfa4b9960f283396427828deac6f194893cc811 (patch)
tree20b0a98726e000cb8ff8a82da246eb985a6e1c61 /tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
parentb9f7add531ceab2590e2b24dec7b495950f9870a (diff)
QNX: check and use elf.h from alternative location
In QNX, instead of #include <elf.h>, we have to use #include <sys/elf.h> since that file is placed in a subdirectory. Also removed the previous workaround. Fixes: QTBUG-97833 Change-Id: Id932a5eeb618a42c8778459cdfd8bb5bf903523c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp')
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index 8994835471..8c68cfde0d 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -94,14 +94,12 @@
# define PREFIX "lib"
#endif
-// Workaround for missing elf.h in QNX test environment
-// TODO: this can be removed after QTBUG-97833 has been solved
-#if defined(Q_OF_ELF) && defined(Q_OS_QNX) && !__has_include(<elf.h>)
-#undef Q_OF_ELF
+#if defined(Q_OF_ELF)
+#if __has_include(<elf.h>)
+# include <elf.h>
+#else
+# include <sys/elf.h>
#endif
-
-#if defined (Q_OF_ELF)
-# include <elf.h>
# include <memory>
# include <functional>
@@ -183,7 +181,7 @@ static std::unique_ptr<QTemporaryFile> patchElf(const QString &source, ElfPatche
if (QTest::currentTestFailed()) return; \
std::move(r); \
})
-#endif
+#endif // Q_OF_ELF
static QString sys_qualifiedLibraryName(const QString &fileName)
{
@@ -395,7 +393,8 @@ void tst_QPluginLoader::deleteinstanceOnUnload()
}
}
-#if defined (Q_OF_ELF)
+#if defined(Q_OF_ELF)
+
void tst_QPluginLoader::loadDebugObj()
{
#if !defined(QT_SHARED)