summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFilipe Azevedo <filipe.azevedo@kdab.com>2016-06-23 15:01:40 +0200
committerFilipe Azevedo <filipe.azevedo@kdab.com>2017-02-12 18:25:42 +0000
commit9db8c171e7bd775ed4cf5281fe17f8084c0ffbcd (patch)
tree518c2cc9ddb8c65276d6db3c1dcf8c247b2ad643 /tests
parentb2ffc4d0a0c7e498da68851b97963a8b7534847d (diff)
Fix QLibrary::isLibrary on Apple platforms
Add proper support for 'so' and 'bundle' suffixes. Qt wrongly assumes .so libraries are not versioned on Apple platforms, which is wrong. Also, the shared library .bundle which is what Apple recommends instead of .so, are also versioned (not to be confound with the different Core Foundation bundles, which are directory hierarchy). For more info, see http://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm. Especially the part that reads: "Loadable modules, called bundles in Mac OS X, have the file type MH_BUNDLE. Most Unix-based software ports usually produce bundles with a .so extension, for the sake of consistency across platforms. Although Apple recommends giving bundles a .bundle extension, it isn't mandatory." Task-number: QTBUG-50446 Change-Id: Iacd5136397a12d65d83821434f332eb602550b4b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
index 42fed1191b..16177bb0b7 100644
--- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
@@ -302,15 +302,10 @@ void tst_QLibrary::isLibrary_data()
QTest::newRow(".sl") << QString("mylib.sl") << sl_VALID;
QTest::newRow(".so") << QString("mylib.so") << so_VALID;
QTest::newRow(".so+version") << QString("mylib.so.0") << so_VALID;
-
- // special tests:
-#ifndef Q_OS_MAC
QTest::newRow("version+.so") << QString("libc-2.7.so") << so_VALID;
QTest::newRow("version+.so+version") << QString("liboil-0.3.so.0.1.0") << so_VALID;
-#else
- QTest::newRow("version+.so") << QString("libc-2.7.so") << false;
- QTest::newRow("version+.so+version") << QString("liboil-0.3.so.0.1.0") << false;
-#endif
+
+ // special tests:
#ifdef Q_OS_MAC
QTest::newRow("good (libmylib.1.0.0.dylib)") << QString("libmylib.1.0.0.dylib") << true;
QTest::newRow("good (libmylib.dylib)") << QString("libmylib.dylib") << true;