Re: Including test "main" programs in modules?
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Wed, 25 Apr 2007 09:22:30 -0800
David Simpson wrote:
I would like to have small "main" programs at the end of each module I
write, which basically run just that module for testing and as
examples. At the moment I have to comment these out when applied as
part of larger code which is using these modules, or to make separate
test programs for each module.
The two ways I think of now, are using the C preprocessor,
#ifdef TEST
#endif
You can set environment variables from the command line with most
compilers.
The other is D lines, I believe inherited by most current compilers
from a DEC feature. At least gfortran, g95, and ifort have it.
Instead of using C for a comment, you use D in column one for
debugging (or testing) code, with a compile time option to
treat it as a comment or code.
-- glen
.
- References:
- Including test "main" programs in modules?
- From: David Simpson
- Including test "main" programs in modules?
- Prev by Date: Re: Interesting bug in (admittedly old) MS FORTRAN 5.1
- Next by Date: Re: Read a .BMP into Fortran?
- Previous by thread: Re: Including test "main" programs in modules?
- Next by thread: Re: Including test "main" programs in modules?
- Index(es):
Relevant Pages
|