Skip to content

Commit 768b019

Browse files
bonachearouson
authored andcommitted
Repair the non-functional false-assertion test
This test has apparently been returning nonsense since the false-assertion example was renamed in 6f4ddfd. The test design (nested invocation of fpm) remains horribly fragile for multiple fundamental reasons, but at least it's once again working as intended (at least on gfortran).
1 parent 8e33ee8 commit 768b019

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

test/run-false-assertion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
2-
output=$(fpm run --example false_assertion --compiler flang-new --flag '-mmlir -allow-assumed-rank -O3' > /dev/null 2>&1)
2+
output=$(fpm run --example false-assertion --compiler flang-new --flag '-mmlir -allow-assumed-rank -O3 -DASSERTIONS' > /dev/null 2>&1)
33
echo $?

test/test-assert-subroutine-error-termination.F90

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ program test_assert_subroutine_error_termination
55

66
integer exit_status
77

8-
! TODO: add '--profile release' if used in the 'fpm test' invocation that causes the program
9-
! ../example/test-assert-subroutine-error-termination.F90 to excute this example program.
10-
118
print *
129
print *,"The assert subroutine"
10+
11+
! TODO: The following is a HORRIBLY fragile test.
12+
! Specifically, it encodes a bunch of compiler-specific flags into an fpm command,
13+
! and if fpm fails for any unrelated reason (broken command, compile error, I/O error, etc)
14+
! we will mistakenly interpret that as a passing test!
15+
1316
call execute_command_line( &
1417
#ifdef __GFORTRAN__
15-
command = "fpm run --example false_assertion > /dev/null 2>&1", &
18+
command = "fpm run --example false-assertion --profile release --flag '-DASSERTIONS -ffree-line-length-0' > /dev/null 2>&1", &
1619
#elif NAGFOR
17-
command = "fpm run --example false_assertion --compiler nagfor --flag -fpp > /dev/null 2>&1", &
20+
command = "fpm run --example false-assertion --compiler nagfor --flag '-DASSERTIONS -fpp' > /dev/null 2>&1", &
1821
#elif __flang__
1922
command = "./test/run-false-assertion.sh | fpm run --example check-exit-status", &
2023
#elif __INTEL_COMPILER
21-
command = "fpm run --example false_assertion --compiler ifx --flag -O3 > /dev/null 2>&1", &
22-
#elif __CRAYFTN
23-
command = "fpm run --example false_assertion --compiler crayftn.sh > /dev/null 2>&1", &
24+
command = "fpm run --example false-assertion --compiler ifx --flag '-DASSERTIONS -O3' > /dev/null 2>&1", &
25+
#elif _CRAYFTN
26+
command = "fpm run --example false-assertion --profile release --compiler crayftn.sh --flag '-DASSERTIONS' > /dev/null 2>&1", &
2427
#else
2528
command = "echo 'example/false_assertion.F90: unsupported compiler' && exit 1", &
2629
#endif

0 commit comments

Comments
 (0)