summaryrefslogtreecommitdiffstats
path: root/Tests/Complex
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-12-23 19:50:21 (GMT)
committerBrad King <brad.king@kitware.com>2011-12-23 21:16:49 (GMT)
commit137e5974bcde960cf408eb4027d35defa9a93217 (patch)
treed3d7baa2906c235ae965099ac49ffb6a06f98646 /Tests/Complex
parent63379207e189688d7e266e6b27420300c9761caf (diff)
downloadCMake-137e5974bcde960cf408eb4027d35defa9a93217.zip
CMake-137e5974bcde960cf408eb4027d35defa9a93217.tar.gz
CMake-137e5974bcde960cf408eb4027d35defa9a93217.tar.bz2
complex: Remove dynamic loader tests
Everything covered by these tests is now covered by the KWSys DynamicLoader test and the Plugin test.
Diffstat (limited to 'Tests/Complex')
-rw-r--r--Tests/Complex/Executable/complex.cxx62
-rw-r--r--Tests/Complex/Library/CMakeLists.txt1
-rw-r--r--Tests/Complex/Library/moduleFile.c6
-rw-r--r--Tests/Complex/Library/moduleFile.h12
4 files changed, 1 insertions, 80 deletions
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index bd7d6fd..b44a43e 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -11,10 +11,8 @@ extern "C" {
#ifdef COMPLEX_TEST_CMAKELIB
#include "cmStandardIncludes.h"
#include "cmSystemTools.h"
-#include "cmDynamicLoader.h"
#include "cmSystemTools.h"
#include "cmGeneratedFileStream.h"
-#include <cmsys/DynamicLoader.hxx>
#else
#include <vector>
#include <string>
@@ -232,12 +230,6 @@ extern "C" int NameConflictTest2();
int main()
{
- std::string lib = BINARY_DIR;
- lib += "/lib/";
-#ifdef CMAKE_INTDIR
- lib += CMAKE_INTDIR;
- lib += "/";
-#endif
std::string exe = BINARY_DIR;
exe += "/bin/";
#ifdef CMAKE_INTDIR
@@ -273,59 +265,7 @@ int main()
{
cmPassed("run Single Character executable A returned 10 as expected.");
}
-
- lib += CMAKE_SHARED_MODULE_PREFIX;
- lib += "CMakeTestModule";
- lib += CMAKE_SHARED_MODULE_SUFFIX;
- cmsys::DynamicLoader::LibraryHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
- if(!handle)
- {
- std::string err = "Can not open CMakeTestModule:\n";
- err += lib;
- cmFailed(err.c_str());
- }
- else
- {
- cmsys::DynamicLoader::SymbolPointer fun =
- cmsys::DynamicLoader::GetSymbolAddress(handle, "ModuleFunction");
- if(!fun)
- {
- fun = cmsys::DynamicLoader::GetSymbolAddress(handle, "_ModuleFunction");
- }
- typedef int (*TEST_FUNCTION)();
- TEST_FUNCTION testFun = (TEST_FUNCTION)fun;
- if(!testFun)
- {
- cmFailed("Could not find symbol ModuleFunction in library ");
- }
- else
- {
- int ret = (*testFun)();
- if(!ret)
- {
- cmFailed("ModuleFunction call did not return valid return.");
- }
- cmPassed("Module loaded and ModuleFunction called correctly.");
- }
- }
- cmDynamicLoader::FlushCache(); // fix memory leaks
- if(sharedFunction() != 1)
- {
- cmFailed("Call to sharedFunction from shared library failed.");
- }
- else
- {
- cmPassed("Call to sharedFunction from shared library worked.");
- }
- if(CsharedFunction() != 1)
- {
- cmFailed("Call to C sharedFunction from shared library failed.");
- }
- else
- {
- cmPassed("Call to C sharedFunction from shared library worked.");
- }
-
+
// ----------------------------------------------------------------------
// Test cmSystemTools::UpperCase
std::string str = "abc";
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 281e48a..c8efc30 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -43,7 +43,6 @@ ENDIF(WIN32)
#
SET(SharedLibrarySources sharedFile)
ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources})
-ADD_LIBRARY(CMakeTestModule MODULE moduleFile.c)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS")
ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
DEFINE_PROPERTY(
diff --git a/Tests/Complex/Library/moduleFile.c b/Tests/Complex/Library/moduleFile.c
deleted file mode 100644
index 608d750..0000000
--- a/Tests/Complex/Library/moduleFile.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "moduleFile.h"
-
-int ModuleFunction()
-{
- return 1;
-}
diff --git a/Tests/Complex/Library/moduleFile.h b/Tests/Complex/Library/moduleFile.h
deleted file mode 100644
index 6b561e1..0000000
--- a/Tests/Complex/Library/moduleFile.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#if defined(_WIN32) || defined(WIN32) /* Win32 version */
-#ifdef CMakeTestModule_EXPORTS
-# define CMakeTest_EXPORT __declspec(dllexport)
-#else
-# define CMakeTest_EXPORT __declspec(dllimport)
-#endif
-#else
-/* unix needs nothing */
-#define CMakeTest_EXPORT
-#endif
-
-CMakeTest_EXPORT int ModuleFunction();