diff options
author | Janne Juntunen <janne.juntunen@qt.io> | 2021-10-28 15:59:55 +0300 |
---|---|---|
committer | Janne Juntunen <janne.juntunen@qt.io> | 2021-10-28 20:14:45 +0300 |
commit | 825505c4398983deb279b9fc2655ab5b6d44fb9a (patch) | |
tree | ba35f08300840daebdd2a9f0c8e199e54cfc159e /tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp | |
parent | 0f6453703c4b7b51c3bbc94983426082c9b72f6a (diff) |
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 <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp')
-rw-r--r-- | tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
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(<elf.h>) +#undef Q_OF_ELF +#endif + +#if defined (Q_OF_ELF) # include <elf.h> # include <memory> # include <functional> @@ -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) { |