]> git.saurik.com Git - wxWidgets.git/commitdiff
Test for the shared library existence in DynamicLibraryTestCase.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 23:13:38 +0000 (23:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 23:13:38 +0000 (23:13 +0000)
Trying to understand why does the test fail in some build slaves builds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/misc/dynamiclib.cpp

index acd16c4e47a5767d38c5ec7c8ad253b19c47f1b5..7f69dc53b23fbdf805f3fb12ef358ac46b21d62b 100644 (file)
 
 #include "wx/dynlib.h"
 
+#ifdef __UNIX__
+    #include "wx/filename.h"
+#endif
+
 // ----------------------------------------------------------------------------
 // test class
 // ----------------------------------------------------------------------------
@@ -57,6 +61,13 @@ void DynamicLibraryTestCase::Load()
     static const wxChar *LIB_NAME = wxT("/lib/libc.so.6");
 #endif
     static const wxChar *FUNC_NAME = wxT("strlen");
+
+    if ( !wxFileName::Exists(LIB_NAME) )
+    {
+        wxLogWarning("Shared library \"%s\" doesn't exist, "
+                     "skipping DynamicLibraryTestCase::Load() test.");
+        return;
+    }
 #else
     #error "don't know how to test wxDllLoader on this platform"
 #endif