diff options
-rw-r--r-- | Tests/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 85 | ||||
-rw-r--r-- | Tests/FortranModules/CMakeLists.txt | 78 | ||||
-rw-r--r-- | Tests/FortranModules/Executable/CMakeLists.txt (renamed from Tests/Fortran/Executable/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Executable/main.f90 (renamed from Tests/Fortran/Executable/main.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/External/CMakeLists.txt (renamed from Tests/Fortran/External/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/External/a.f90 (renamed from Tests/Fortran/External/a.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Library/CMakeLists.txt (renamed from Tests/Fortran/Library/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Library/a.f90 (renamed from Tests/Fortran/Library/a.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Library/b.f90 (renamed from Tests/Fortran/Library/b.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Library/main.f90 (renamed from Tests/Fortran/Library/main.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Subdir/CMakeLists.txt (renamed from Tests/Fortran/Subdir/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/Subdir/subdir.f90 (renamed from Tests/Fortran/Subdir/subdir.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/in_interface/main.f90 (renamed from Tests/Fortran/in_interface/main.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/in_interface/module.f90 (renamed from Tests/Fortran/in_interface/module.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/include/test_preprocess.h (renamed from Tests/Fortran/include/test_preprocess.h) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_module_implementation.f90 (renamed from Tests/Fortran/test_module_implementation.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_module_interface.f90 (renamed from Tests/Fortran/test_module_interface.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_module_main.f90 (renamed from Tests/Fortran/test_module_main.f90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_preprocess.F90 (renamed from Tests/Fortran/test_preprocess.F90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_preprocess_module.F90 (renamed from Tests/Fortran/test_preprocess_module.F90) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_use_in_comment_fixedform.f (renamed from Tests/Fortran/test_use_in_comment_fixedform.f) | 0 | ||||
-rw-r--r-- | Tests/FortranModules/test_use_in_comment_freeform.f90 (renamed from Tests/Fortran/test_use_in_comment_freeform.f90) | 0 |
23 files changed, 91 insertions, 86 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8cf1faa..235e38a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -3097,10 +3097,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release --build-project testf --build-two-config --build-options ${build_options} - -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} --test-command testf) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") + if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) + add_test(FortranModules ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FortranModules" + "${CMake_BINARY_DIR}/Tests/FortranModules" + ${build_generator_args} + --build-project FortranModules + --build-options ${build_options} + -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranModules") + endif() + # FortranCInterface tests. if(UNIX) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 3105d13..740e6f5 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -1,8 +1,5 @@ cmake_minimum_required (VERSION 3.1) project(testf C CXX Fortran) -if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") - set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") -endif() message("CTEST_FULL_OUTPUT ") set(CMAKE_VERBOSE_MAKEFILE 1) @@ -144,85 +141,3 @@ else() endif() endif() - - - - -set(TEST_MODULE_DEPENDS 0) -if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) - add_executable(test_module - test_module_main.f90 - test_module_implementation.f90 - test_module_interface.f90) - - add_executable(test_use_in_comment_fixedform - test_use_in_comment_fixedform.f) - set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED) - add_executable(test_use_in_comment_freeform - test_use_in_comment_freeform.f90) - set_property(SOURCE test_use_in_comment_freeform.f90 PROPERTY Fortran_FORMAT FREE) - - add_executable(test_in_interface - in_interface/main.f90 - in_interface/module.f90) - - add_definitions(-DFOO -DBAR=1) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - add_executable(test_preprocess test_preprocess.F90 test_preprocess_module.F90) - - set(TEST_MODULE_DEPENDS 1) -endif() - -if(TEST_MODULE_DEPENDS) - # Build the external project separately using a custom target. - # Make sure it uses the same build configuration as this test. - if(CMAKE_CONFIGURATION_TYPES) - set(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") - set(External_BUILD_TYPE) - else() - set(External_CONFIG_TYPE) - set(External_BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) - endif() - set(External_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External") - set(External_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/External") - if("${CMAKE_CURRENT_BINARY_DIR}" MATCHES " ") - # Our build tree has a space, so the build tool supports spaces. - # Test using modules from a path with spaces. - string(APPEND External_BINARY_DIR " Build") - endif() - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ExternalProject - COMMAND ${CMAKE_CTEST_COMMAND} - ARGS ${External_CONFIG_TYPE} - --build-and-test - ${External_SOURCE_DIR} - ${External_BINARY_DIR} - --build-noclean - --build-two-config - --build-project ExtFort - --build-generator ${CMAKE_GENERATOR} - --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" - --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" - --build-options -DCMAKE_Fortran_COMPILER:STRING=${CMAKE_Fortran_COMPILER} - -DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS} - -DCMAKE_Fortran_FLAGS_DEBUG:STRING=${CMAKE_Fortran_FLAGS_DEBUG} - -DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE} - -DCMAKE_Fortran_FLAGS_MINSIZEREL:STRING=${CMAKE_Fortran_FLAGS_MINSIZEREL} - -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} - -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_NESTED_MAKE_PROGRAM} - ${External_BUILD_TYPE} - VERBATIM - ) - add_custom_target(ExternalTarget ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ExternalProject) - - # Test module output directory if available. - if(CMAKE_Fortran_MODDIR_FLAG) - set(Library_MODDIR "${CMAKE_CURRENT_BINARY_DIR}/Library/modules") - else() - set(Library_MODDIR "${CMAKE_CURRENT_BINARY_DIR}/Library") - endif() - - add_subdirectory(Library) - add_subdirectory(Subdir) - add_subdirectory(Executable) -endif() diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt new file mode 100644 index 0000000..b406df3 --- /dev/null +++ b/Tests/FortranModules/CMakeLists.txt @@ -0,0 +1,78 @@ +cmake_minimum_required (VERSION 3.1) +project(FortranModules Fortran) + +if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio") + set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}") +endif() + +add_executable(test_module + test_module_main.f90 + test_module_implementation.f90 + test_module_interface.f90) + +add_executable(test_use_in_comment_fixedform + test_use_in_comment_fixedform.f) +set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED) +add_executable(test_use_in_comment_freeform + test_use_in_comment_freeform.f90) +set_property(SOURCE test_use_in_comment_freeform.f90 PROPERTY Fortran_FORMAT FREE) + +add_executable(test_in_interface + in_interface/main.f90 + in_interface/module.f90) + +add_definitions(-DFOO -DBAR=1) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +add_executable(test_preprocess test_preprocess.F90 test_preprocess_module.F90) + +# Build the external project separately using a custom target. +# Make sure it uses the same build configuration as this test. +if(CMAKE_CONFIGURATION_TYPES) + set(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") + set(External_BUILD_TYPE) +else() + set(External_CONFIG_TYPE) + set(External_BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) +endif() +set(External_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/External") +set(External_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/External") +if("${CMAKE_CURRENT_BINARY_DIR}" MATCHES " ") + # Our build tree has a space, so the build tool supports spaces. + # Test using modules from a path with spaces. + string(APPEND External_BINARY_DIR " Build") +endif() +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ExternalProject + COMMAND ${CMAKE_CTEST_COMMAND} + ARGS ${External_CONFIG_TYPE} + --build-and-test + ${External_SOURCE_DIR} + ${External_BINARY_DIR} + --build-noclean + --build-two-config + --build-project ExtFort + --build-generator ${CMAKE_GENERATOR} + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" + --build-options -DCMAKE_Fortran_COMPILER:STRING=${CMAKE_Fortran_COMPILER} + -DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS} + -DCMAKE_Fortran_FLAGS_DEBUG:STRING=${CMAKE_Fortran_FLAGS_DEBUG} + -DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE} + -DCMAKE_Fortran_FLAGS_MINSIZEREL:STRING=${CMAKE_Fortran_FLAGS_MINSIZEREL} + -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_Fortran_FLAGS_RELWITHDEBINFO} + -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_NESTED_MAKE_PROGRAM} + ${External_BUILD_TYPE} + VERBATIM + ) +add_custom_target(ExternalTarget ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ExternalProject) + +# Test module output directory if available. +if(CMAKE_Fortran_MODDIR_FLAG) + set(Library_MODDIR "${CMAKE_CURRENT_BINARY_DIR}/Library/modules") +else() + set(Library_MODDIR "${CMAKE_CURRENT_BINARY_DIR}/Library") +endif() + +add_subdirectory(Library) +add_subdirectory(Subdir) +add_subdirectory(Executable) diff --git a/Tests/Fortran/Executable/CMakeLists.txt b/Tests/FortranModules/Executable/CMakeLists.txt index de08d86..de08d86 100644 --- a/Tests/Fortran/Executable/CMakeLists.txt +++ b/Tests/FortranModules/Executable/CMakeLists.txt diff --git a/Tests/Fortran/Executable/main.f90 b/Tests/FortranModules/Executable/main.f90 index 640259c..640259c 100644 --- a/Tests/Fortran/Executable/main.f90 +++ b/Tests/FortranModules/Executable/main.f90 diff --git a/Tests/Fortran/External/CMakeLists.txt b/Tests/FortranModules/External/CMakeLists.txt index c90a0ffb..c90a0ffb 100644 --- a/Tests/Fortran/External/CMakeLists.txt +++ b/Tests/FortranModules/External/CMakeLists.txt diff --git a/Tests/Fortran/External/a.f90 b/Tests/FortranModules/External/a.f90 index 2be73c5..2be73c5 100644 --- a/Tests/Fortran/External/a.f90 +++ b/Tests/FortranModules/External/a.f90 diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/FortranModules/Library/CMakeLists.txt index 17438ca..17438ca 100644 --- a/Tests/Fortran/Library/CMakeLists.txt +++ b/Tests/FortranModules/Library/CMakeLists.txt diff --git a/Tests/Fortran/Library/a.f90 b/Tests/FortranModules/Library/a.f90 index 3031c07..3031c07 100644 --- a/Tests/Fortran/Library/a.f90 +++ b/Tests/FortranModules/Library/a.f90 diff --git a/Tests/Fortran/Library/b.f90 b/Tests/FortranModules/Library/b.f90 index ae1edcb..ae1edcb 100644 --- a/Tests/Fortran/Library/b.f90 +++ b/Tests/FortranModules/Library/b.f90 diff --git a/Tests/Fortran/Library/main.f90 b/Tests/FortranModules/Library/main.f90 index 2385408..2385408 100644 --- a/Tests/Fortran/Library/main.f90 +++ b/Tests/FortranModules/Library/main.f90 diff --git a/Tests/Fortran/Subdir/CMakeLists.txt b/Tests/FortranModules/Subdir/CMakeLists.txt index 52683e5..52683e5 100644 --- a/Tests/Fortran/Subdir/CMakeLists.txt +++ b/Tests/FortranModules/Subdir/CMakeLists.txt diff --git a/Tests/Fortran/Subdir/subdir.f90 b/Tests/FortranModules/Subdir/subdir.f90 index 68955f6..68955f6 100644 --- a/Tests/Fortran/Subdir/subdir.f90 +++ b/Tests/FortranModules/Subdir/subdir.f90 diff --git a/Tests/Fortran/in_interface/main.f90 b/Tests/FortranModules/in_interface/main.f90 index 28bcf36..28bcf36 100644 --- a/Tests/Fortran/in_interface/main.f90 +++ b/Tests/FortranModules/in_interface/main.f90 diff --git a/Tests/Fortran/in_interface/module.f90 b/Tests/FortranModules/in_interface/module.f90 index 1064d74..1064d74 100644 --- a/Tests/Fortran/in_interface/module.f90 +++ b/Tests/FortranModules/in_interface/module.f90 diff --git a/Tests/Fortran/include/test_preprocess.h b/Tests/FortranModules/include/test_preprocess.h index f4a00a9..f4a00a9 100644 --- a/Tests/Fortran/include/test_preprocess.h +++ b/Tests/FortranModules/include/test_preprocess.h diff --git a/Tests/Fortran/test_module_implementation.f90 b/Tests/FortranModules/test_module_implementation.f90 index de3cb57..de3cb57 100644 --- a/Tests/Fortran/test_module_implementation.f90 +++ b/Tests/FortranModules/test_module_implementation.f90 diff --git a/Tests/Fortran/test_module_interface.f90 b/Tests/FortranModules/test_module_interface.f90 index dd0f35c..dd0f35c 100644 --- a/Tests/Fortran/test_module_interface.f90 +++ b/Tests/FortranModules/test_module_interface.f90 diff --git a/Tests/Fortran/test_module_main.f90 b/Tests/FortranModules/test_module_main.f90 index 6ac97fa..6ac97fa 100644 --- a/Tests/Fortran/test_module_main.f90 +++ b/Tests/FortranModules/test_module_main.f90 diff --git a/Tests/Fortran/test_preprocess.F90 b/Tests/FortranModules/test_preprocess.F90 index 3a09976..3a09976 100644 --- a/Tests/Fortran/test_preprocess.F90 +++ b/Tests/FortranModules/test_preprocess.F90 diff --git a/Tests/Fortran/test_preprocess_module.F90 b/Tests/FortranModules/test_preprocess_module.F90 index 5849b62..5849b62 100644 --- a/Tests/Fortran/test_preprocess_module.F90 +++ b/Tests/FortranModules/test_preprocess_module.F90 diff --git a/Tests/Fortran/test_use_in_comment_fixedform.f b/Tests/FortranModules/test_use_in_comment_fixedform.f index 39f486b..39f486b 100644 --- a/Tests/Fortran/test_use_in_comment_fixedform.f +++ b/Tests/FortranModules/test_use_in_comment_fixedform.f diff --git a/Tests/Fortran/test_use_in_comment_freeform.f90 b/Tests/FortranModules/test_use_in_comment_freeform.f90 index 48bcd5a..48bcd5a 100644 --- a/Tests/Fortran/test_use_in_comment_freeform.f90 +++ b/Tests/FortranModules/test_use_in_comment_freeform.f90 |