Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair the non-functional false-assertion test #44

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/run-false-assertion.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
output=$(fpm run --example false_assertion --compiler flang-new --flag '-mmlir -allow-assumed-rank -O3' > /dev/null 2>&1)
output=$(fpm run --example false-assertion --compiler flang-new --flag '-mmlir -allow-assumed-rank -O3 -DASSERTIONS' > /dev/null 2>&1)
echo $?
19 changes: 11 additions & 8 deletions test/test-assert-subroutine-error-termination.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ program test_assert_subroutine_error_termination

integer exit_status

! TODO: add '--profile release' if used in the 'fpm test' invocation that causes the program
! ../example/test-assert-subroutine-error-termination.F90 to excute this example program.

print *
print *,"The assert subroutine"

! TODO: The following is a HORRIBLY fragile test.
! Specifically, it encodes a bunch of compiler-specific flags into an fpm command,
! and if fpm fails for any unrelated reason (broken command, compile error, I/O error, etc)
! we will mistakenly interpret that as a passing test!

call execute_command_line( &
#ifdef __GFORTRAN__
command = "fpm run --example false_assertion > /dev/null 2>&1", &
command = "fpm run --example false-assertion --profile release --flag '-DASSERTIONS -ffree-line-length-0' > /dev/null 2>&1", &
#elif NAGFOR
command = "fpm run --example false_assertion --compiler nagfor --flag -fpp > /dev/null 2>&1", &
command = "fpm run --example false-assertion --compiler nagfor --flag '-DASSERTIONS -fpp' > /dev/null 2>&1", &
#elif __flang__
command = "./test/run-false-assertion.sh | fpm run --example check-exit-status", &
#elif __INTEL_COMPILER
command = "fpm run --example false_assertion --compiler ifx --flag -O3 > /dev/null 2>&1", &
#elif __CRAYFTN
command = "fpm run --example false_assertion --compiler crayftn.sh > /dev/null 2>&1", &
command = "fpm run --example false-assertion --compiler ifx --flag '-DASSERTIONS -O3' > /dev/null 2>&1", &
#elif _CRAYFTN
command = "fpm run --example false-assertion --profile release --compiler crayftn.sh --flag '-DASSERTIONS' > /dev/null 2>&1", &
#else
command = "echo 'example/false_assertion.F90: unsupported compiler' && exit 1", &
#endif
Expand Down