diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,10 @@ include(SingleMultiSource) # Needs by External/sollve_vv. find_package(OpenMP) +# Fortran Helper Modules +if(TEST_SUITE_FORTRAN) + include(Fortran) +endif() if(NOT DEFINED TARGET_OS) message(STATUS "Check target operating system - ${CMAKE_SYSTEM_NAME}") @@ -339,6 +343,10 @@ if(NOT ${subdir} STREQUAL tools AND NOT ${subdir} STREQUAL CTMark) list(APPEND TEST_SUITE_SUBDIRS ${subdir}) endif() + # Exclude Fortran tests unless explicitly activated + if(NOT TEST_SUITE_FORTRAN) + list(REMOVE_ITEM TEST_SUITE_SUBDIRS Fortran) + endif() endforeach() set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}") endif() diff --git a/Fortran/CMakeLists.txt b/Fortran/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/CMakeLists.txt @@ -0,0 +1,9 @@ +# Fortran TestSuite Directory Structure (TENTATIVE): +# +# UnitTests - Single source tests for language features +# Benchmarks - Single source tests for benchmarking +# Applications - Multi-source tests for proxy apps, small apps, etc. +# +# This file should only contain add_subdirectory(...) one for each test +# directory +add_subdirectory(UnitTests) diff --git a/Fortran/UnitTests/CMakeLists.txt b/Fortran/UnitTests/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/UnitTests/CMakeLists.txt @@ -0,0 +1,2 @@ +# This file should only contain add_subdirectory(...) one for each test +add_subdirectory(hello) diff --git a/Fortran/UnitTests/hello/CMakeLists.txt b/Fortran/UnitTests/hello/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/Fortran/UnitTests/hello/CMakeLists.txt @@ -0,0 +1,3 @@ +llvm_singlesource() + +file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/SingleSource/UnitTests/Fortran/hello.f90 b/Fortran/UnitTests/hello/hello.f90 rename from SingleSource/UnitTests/Fortran/hello.f90 rename to Fortran/UnitTests/hello/hello.f90 diff --git a/SingleSource/UnitTests/Fortran/hello.reference_output b/Fortran/UnitTests/hello/hello.reference_output rename from SingleSource/UnitTests/Fortran/hello.reference_output rename to Fortran/UnitTests/hello/hello.reference_output diff --git a/Fortran/UnitTests/hello/lit.local.cfg b/Fortran/UnitTests/hello/lit.local.cfg new file mode 100644 --- /dev/null +++ b/Fortran/UnitTests/hello/lit.local.cfg @@ -0,0 +1,2 @@ +config.traditional_output = True +config.single_source = True diff --git a/SingleSource/UnitTests/CMakeLists.txt b/SingleSource/UnitTests/CMakeLists.txt --- a/SingleSource/UnitTests/CMakeLists.txt +++ b/SingleSource/UnitTests/CMakeLists.txt @@ -12,11 +12,6 @@ add_subdirectory(ObjC++) endif() -# Fortran -if(TEST_SUITE_FORTRAN) - add_subdirectory(Fortran) -endif() - file(GLOB Source RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c *.cpp) if(TARGET_OS STREQUAL "AIX" AND ARCH STREQUAL "PowerPC" AND NOT PPC_IS_PPC64_ENABLED) list(REMOVE_ITEM Source AtomicOps.c) diff --git a/SingleSource/UnitTests/Fortran/CMakeLists.txt b/SingleSource/UnitTests/Fortran/CMakeLists.txt deleted file mode 100644 --- a/SingleSource/UnitTests/Fortran/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -llvm_singlesource()