From 825505c4398983deb279b9fc2655ab5b6d44fb9a Mon Sep 17 00:00:00 2001 From: Janne Juntunen Date: Thu, 28 Oct 2021 15:59:55 +0300 Subject: QNX: Handle missing elf.h gracefully It seems that after commit id 46fc01d7ca10ab95e53206077c7c710d2032b4f0 the qpluginloder test case cannot find elf.h in QNX test environment. This is just a workaround, fix for missing elf.h (QTBUG-97833) needs to be done later on. Change-Id: I3f6ec36c8ceaed82552fd0e156a56637c056780d Reviewed-by: Alexandru Croitor Reviewed-by: Edward Welbourne --- .../corelib/plugin/qpluginloader/tst_qpluginloader.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp index d09a6967e5..7d95004709 100644 --- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp @@ -93,7 +93,13 @@ # define PREFIX "lib" #endif -#if defined(Q_OF_ELF) +// 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() +#undef Q_OF_ELF +#endif + +#if defined (Q_OF_ELF) # include # include # include @@ -198,7 +204,7 @@ private slots: void errorString(); void loadHints(); void deleteinstanceOnUnload(); -#if defined (__ELF__) +#if defined (Q_OF_ELF) void loadDebugObj(); void loadCorruptElf_data(); void loadCorruptElf(); @@ -388,7 +394,7 @@ void tst_QPluginLoader::deleteinstanceOnUnload() } } -#if defined (__ELF__) +#if defined (Q_OF_ELF) void tst_QPluginLoader::loadDebugObj() { #if !defined(QT_SHARED) @@ -823,7 +829,7 @@ void tst_QPluginLoader::loadCorruptElfOldPlugin() loadCorruptElf_helper(sys_qualifiedLibraryName("theoldplugin")); } # endif // Qt 7 -#endif // __ELF__ +#endif // Q_OF_ELF void tst_QPluginLoader::loadMachO_data() { @@ -964,7 +970,7 @@ void tst_QPluginLoader::loadSectionTableStrippedElf() { #if !defined(QT_SHARED) QSKIP("This test requires a shared build of Qt, as QPluginLoader::setFileName is a no-op in static builds"); -#elif !defined(__ELF__) +#elif !defined(Q_OF_ELF) QSKIP("Test specific to the ELF file format"); #else ElfPatcher patcher { [](ElfHeader *header, QFile *f) { -- cgit v1.2.3