diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index bd7d6fdfe..b44a43e82 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 #else #include #include @@ -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 281e48a55..c8efc3022 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 608d750f1..000000000 --- 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 6b561e109..000000000 --- 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(); diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index bd7d6fdfe..b44a43e82 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/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 #else #include #include @@ -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/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index 281e48a55..c8efc3022 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/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/ComplexOneConfig/Library/moduleFile.c b/Tests/ComplexOneConfig/Library/moduleFile.c deleted file mode 100644 index 608d750f1..000000000 --- a/Tests/ComplexOneConfig/Library/moduleFile.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "moduleFile.h" - -int ModuleFunction() -{ - return 1; -} diff --git a/Tests/ComplexOneConfig/Library/moduleFile.h b/Tests/ComplexOneConfig/Library/moduleFile.h deleted file mode 100644 index 6b561e109..000000000 --- a/Tests/ComplexOneConfig/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();