Skip to content

Commit 5633212

Browse files
authored
Fix Fortran tests for Windows platform (#69)
This patch makes minor changes to ignore windows line endings when Fortran tests are run on windows platform.
1 parent d6b5c68 commit 5633212

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Fortran/SNAP/src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ if(PROJECT_NAME STREQUAL "test-suite")
149149
snap.reference_output
150150
)
151151
set(DIFFPROG_BASE %b/${FPCMP})
152+
if(FP_IGNOREWHITESPACE)
153+
set(DIFFPROG_BASE "${DIFFPROG_BASE} -i")
154+
endif()
152155
set(FP_TOL_SUFFIX "-r ${FP_TOLERANCE}")
153156
set(FP_ABSTOL_SUFFIX "-a ${FP_ABSTOLERANCE}")
154157
set(DIFFPROG

Fortran/UnitTests/fcvs21_f95/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ endif()
8282
# Skip some tests that currently fail with flang on AArch64 when using libpgmath.
8383
# FIXME: Reenable these tests after libpgmath is fixed or after we no longer
8484
# depend on it.
85-
if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND ARCH STREQUAL "AArch64")
85+
if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang"
86+
AND (ARCH STREQUAL "AArch64" OR TARGET_OS STREQUAL "Windows"))
8687
# Regex because the GLOB returns the full path to each file
8788
list(FILTER Source EXCLUDE REGEX "FM813\.f$")
8889
list(FILTER Source EXCLUDE REGEX "FM815\.f$")
@@ -94,7 +95,9 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND ARCH STREQUAL "AArch64")
9495
endif()
9596

9697
set(FP_TOLERANCE 1.0e-11) # set by the most sensitive numerical test
97-
set(FP_IGNOREWHITESPACE OFF)
98+
if (NOT TARGET_OS STREQUAL "Windows")
99+
set(FP_IGNOREWHITESPACE OFF)
100+
endif()
98101
llvm_singlesource()
99102

100103
file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")

0 commit comments

Comments
 (0)