summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in5
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CPack/CPackTestHelpers.cmake41
-rw-r--r--Tests/RunCMake/CPack/DEPENDENCIES.cmake8
-rw-r--r--Tests/RunCMake/CPack/PreTestError.cmake7
-rw-r--r--Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt6
6 files changed, 16 insertions, 54 deletions
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index e4df9d6..8e7ff72 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -4,6 +4,7 @@ include cmakeExecutable.mk
CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"
CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"
+CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@
CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
@@ -14,7 +15,7 @@ all: pngtest
main.o: clean main.cpp
@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
@@ -22,7 +23,7 @@ main.o: clean main.cpp
pngtest: main.o
@$(CMAKE_FOO) -DMODE=LINK >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CXXFLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s -o pngtest main.o %s\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(LDFLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index c538280..ffee035 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -25,7 +25,8 @@ if (NOT CMAKE_CXX_COMPILE_FEATURES AND NOT CMAKE_C_COMPILE_FEATURES)
)
add_executable(WriteCompilerDetectionHeader "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
- if(UNIX OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ if((UNIX OR NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("#include \"${CMAKE_CURRENT_BINARY_DIR}/test_compiler_detection.h\"\nint main() { return 0; }\n"
file_include_works
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
index 7ea2a24..aef1086 100644
--- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake
+++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
@@ -10,47 +10,12 @@ function(run_cpack_test TEST_NAME types build)
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
# execute cmake
- execute_process(
- COMMAND "${CMAKE_COMMAND}" -DRunCMake_TEST=${TEST_NAME}
- -DGENERATOR_TYPE=${TEST_TYPE} "${RunCMake_SOURCE_DIR}"
- WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
- RESULT_VARIABLE res
- OUTPUT_FILE "${RunCMake_TEST_BINARY_DIR}/test_output.txt"
- ERROR_FILE "${RunCMake_TEST_BINARY_DIR}/test_error.txt"
- )
-
- if(res)
- run_cmake_command(
- ${TEST_TYPE}/${TEST_NAME}
- "${CMAKE_COMMAND}"
- -DRunCMake_TEST_STEP=configure
- -Dreturn_code=${res}
- "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
- -P "${RunCMake_SOURCE_DIR}/PreTestError.cmake"
- )
- return()
- endif()
+ set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${TEST_TYPE}")
+ run_cmake(${TEST_NAME})
# execute optional build step
if(build)
- execute_process(
- COMMAND "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}"
- RESULT_VARIABLE res
- OUTPUT_FILE "${RunCMake_TEST_BINARY_DIR}/test_output.txt"
- ERROR_FILE "${RunCMake_TEST_BINARY_DIR}/test_error.txt"
- )
- endif()
-
- if(res)
- run_cmake_command(
- ${TEST_TYPE}/${TEST_NAME}
- "${CMAKE_COMMAND}"
- -DRunCMake_TEST_STEP=build
- -Dreturn_code=${res}
- "-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
- -P "${RunCMake_SOURCE_DIR}/PreTestError.cmake"
- )
- return()
+ run_cmake_command(${TEST_NAME}-Build "${CMAKE_COMMAND}" --build "${RunCMake_TEST_BINARY_DIR}")
endif()
# execute cpack
diff --git a/Tests/RunCMake/CPack/DEPENDENCIES.cmake b/Tests/RunCMake/CPack/DEPENDENCIES.cmake
index 0aef925..4f6d65f 100644
--- a/Tests/RunCMake/CPack/DEPENDENCIES.cmake
+++ b/Tests/RunCMake/CPack/DEPENDENCIES.cmake
@@ -1,11 +1,13 @@
+set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp"
- "int test_lib();")
+ "int test_lib();\n")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp"
- "#include \"test_lib.hpp\"\nint test_lib() {return 0;}")
+ "#include \"test_lib.hpp\"\nint test_lib() {return 0;}\n")
add_library(test_lib SHARED "${CMAKE_CURRENT_BINARY_DIR}/test_lib.cpp")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
- "#include \"test_lib.hpp\"\nint main() {return test_lib();}")
+ "#include \"test_lib.hpp\"\nint main() {return test_lib();}\n")
add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
target_link_libraries(test_prog test_lib)
diff --git a/Tests/RunCMake/CPack/PreTestError.cmake b/Tests/RunCMake/CPack/PreTestError.cmake
deleted file mode 100644
index f88f2e8..0000000
--- a/Tests/RunCMake/CPack/PreTestError.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-file(READ "${bin_dir}/test_output.txt" output)
-file(READ "${bin_dir}/test_error.txt" error)
-
-message(FATAL_ERROR "Error in pre-test phase '${RunCMake_TEST_STEP}'!\n"
- "Return code: '${return_code}'\n"
- "Info output: '${output}'\n"
- "Error output: '${error}'")
diff --git a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
index 3ee1855..f68e38e 100644
--- a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
+++ b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
@@ -35,12 +35,12 @@ add_library(hello SHARED hello.f)
add_library(world SHARED world.f)
target_link_libraries(hello world)
if(CMAKE_Fortran_COMPILER_ID MATCHES SunPro)
- target_link_libraries(hello fsu)
+ target_link_libraries(hello PRIVATE fsu)
if(CMAKE_Fortran_PLATFORM_ID MATCHES SunOS)
- target_link_libraries(hello sunmath m)
+ target_link_libraries(hello PRIVATE sunmath m)
test_sunquad(CMAKE_HAS_SUNQUAD)
if(CMAKE_HAS_SUNQUAD)
- target_link_libraries(hello sunquad)
+ target_link_libraries(hello PRIVATE sunquad)
endif()
endif()
endif()