diff --git a/fortran/Makefile b/fortran/Makefile index bbb15ab8..ab53e265 100644 --- a/fortran/Makefile +++ b/fortran/Makefile @@ -70,4 +70,4 @@ test_%: .PHONY: clean clean: - @rm -rf $(BUILD_DIR) test_runner + @rm -rf $(BUILD_DIR) test_runner problems.f90 diff --git a/fortran/problem_linker.sh b/fortran/problem_linker.sh index 638ba24c..85723d68 100644 --- a/fortran/problem_linker.sh +++ b/fortran/problem_linker.sh @@ -17,7 +17,8 @@ for file in "$SRC_DIR"/p[0-9][0-9][0-9][0-9].f90; do done problem_ids_str=$(printf '%s_i4t, &\n' "${problem_ids[@]}") # Remove the last ', &\n' for proper formatting -problem_ids_str=${problem_ids_str%, &$'\n'} +length=${#problem_ids_str} +problem_ids_str=${problem_ids_str:0:length - 3} # Start writing to the output file cat < $OUTPUT_FILE diff --git a/fortran/test.f90 b/fortran/test.f90 index deef9972..d56d49c5 100644 --- a/fortran/test.f90 +++ b/fortran/test.f90 @@ -17,7 +17,7 @@ subroutine process_problems() ! Loop through each problem do i = 1, size(problem_ids) print *, "Processing Problem ID: ", problem_ids(i) - if (is_slow(i)) then + if (is_slow(problem_ids(i))) then print *, " This problem will take more than 60 seconds." end if expected = get_answer(problem_ids(i)) @@ -68,7 +68,7 @@ subroutine process_problems() tmp = tmp + count_max end if time_elapsed = real(tmp) / real(count_rate) - if (.NOT. is_slow(i) .AND. time_elapsed > 60.0) then + if (.NOT. is_slow(problem_ids(i)) .AND. time_elapsed > 60.0) then print *, " Error: problem ", problem_ids(i), " timed out!" print *, " Solution took : ", time_elapsed, "s" stop 2