I am pleased to annouce the 0.2 release of lutin77 for running Fortran 77 tests by using a C compiler as the only dependency. Moreover this very light framework of 97 lines of C code makes a very good demo of Fortran and C interfacing. The next level could be to write it in GAS (GNU Assembler).
For the over excited maintainers of legacy code, here comes a screenshot:
$ cat test_error.f subroutine success end subroutine error integer fid open(fid, status="old", file="nofile.txt") write(fid, *) "Ola" end subroutine checke call check(.true.) call check(.false.) call abort end program run call runtest("error") call runtest("success") call runtest("absent") call runtest("checke") call resume end
Then you can build the framework by:
$ gcc -Wall -pedantic -c lutin77.c
An now run your tests:
$ gfortran -o test_error test_error.f lutin77.o -ldl -rdynamic $ ./test_error At line 6 of file test_error.f Fortran runtime error: File 'nofile.txt' does not exist Error with status 512 for the test "error". "absent" test not found. Failure at check statement number 2. Error for the test "checke". 4 tests run (1 PASSED, 0 FAILED, 3 ERRORS)
See also the list of test frameworks for Fortran.
blog entry of