f2k  Reference documentation for version 0.0
f2k_tester.f90
Go to the documentation of this file.
1 !----------------------------------------------------------------------------------------
2 !
3 ! This file is part of f2k.
4 !
5 ! Copyright (C) 2016-2017 by the f2k authors
6 !
7 ! The f2k code is free software;
8 ! You can use it, redistribute it, and/or modify it under the terms
9 ! of the GNU General Public License as published by the Free Software Foundation;
10 ! either version 3 of the License, or (at your option) any later version.
11 ! The full text of the license can be found in the file LICENSE at
12 ! the top level of the f2k distribution.
13 !
14 !----------------------------------------------------------------------------------------
15 
18 
19 !----------------------------------------------------------------------------------------
21 
23 
24 module f2k_test
25 
26  implicit none
27 
28  private
29 
30  !----------------------------------------------------------------------------------------
31  ! Internal definitions:
32 
33  !----------------------------------------------------------------------------------------
34  ! public definitions:
35  integer ( kind = 4 ), public :: test_unit = 666
36  public :: start_test, end_test
37 
38  !----------------------------------------------------------------------------------------
39 
40 contains
41 
42  ! ---------------------------------------------------------------------------------------------
50  subroutine start_test( outroot )
51 
52  implicit none
53 
54  character ( len = * ), intent(in), optional :: outroot
55 
56  character ( len = : ), allocatable :: root
57 
58  ! check for the presence of an output path:
59  if ( present( outroot ) ) then
60  root = adjustl( trim( outroot ) )
61  else
62  root = 'output'
63  end if
64  ! open the test output file:
65  open( unit = test_unit, file=root, status='REPLACE', action='WRITE' )
66 
67  end subroutine start_test
68 
69  ! ---------------------------------------------------------------------------------------------
77  subroutine end_test( )
78 
79  implicit none
80 
81  ! close the test output file:
82  close( unit = test_unit )
83 
84  end subroutine end_test
85 
86  ! ---------------------------------------------------------------------------------------------
87 
88 end module f2k_test
This module contains a couple of utilities that are used to run the f2k tests.
Definition: f2k_tester.f90:24
subroutine, public end_test()
Subroutine that ends the test environment.
Definition: f2k_tester.f90:78
subroutine, public start_test(outroot)
Subroutine that starts the test environment.
Definition: f2k_tester.f90:51
integer(kind=4), public test_unit
Definition: f2k_tester.f90:35