next up previous contents index
Next: 5.6.1 F90_UNIT Up: 5. Programmer's guide Previous: 5.5.3 Compiler macros or   Contents   Index


5.6 Unit tests

For a number of subroutines in a few modules, there exist automated unit tests. The master unit-test routine hd/unitt/UT_module.F90 and the corresponding main program hd/unitt/rhdut.F90 reside in for/hd/unitt/.

The Makefile is produced with the usual configure script (see Sect.4.3). The usual environment variables e.g. for optimization are still valid. However, the unit testing is controlled with the variable F90_UNIT and the new make target is UT or rhdut.exe. A complete installation, compilation, and run of the unit tests could look like:

tar -zxvf for.tar.gz
cd for/hd/rhd
mkdir -p UNIT_TESTS_ON_YOUR_MACHINE
cd UNIT_TESTS_ON_YOUR_MACHINE
ln -s ../conf/configure .
export F90_UNIT=1
./configure
make UT
echo -e "$(./rhdut.exe)"
The trickery with echo causes colored output - that is activated by default - to be properly displayed.

So far, the coverage of the unit tests is microscopic, i.e., a successful unit-test run does not tell much about the correctness of the entire code. While the coverage will hopefully increase with time, there is no intention to try to cover higher-level modules or the entire code. Such tests are and will be made with normal test runs of the entire code - hopefully better automated in the future.



Subsections
next up previous contents index
Next: 5.6.1 F90_UNIT Up: 5. Programmer's guide Previous: 5.5.3 Compiler macros or   Contents   Index