source: branches/2015/dev_r5021_UKMO1_CICE_coupling/NEMOGCM/EXTERNAL/fcm/t/Fcm/Build/Fortran.t @ 5445

Last change on this file since 5445 was 5445, checked in by davestorkey, 5 years ago

Clear SVN keywords from 2015/dev_r5021_UKMO1_CICE_coupling branch.

File size: 1.3 KB
Line 
1#!/usr/bin/perl
2# ------------------------------------------------------------------------------
3# (C) Crown copyright Met Office. All rights reserved.
4# For further details please refer to the file COPYRIGHT.txt
5# which you should have received as part of this distribution.
6# ------------------------------------------------------------------------------
7
8use strict;
9use warnings;
10
11use FindBin;
12use lib "$FindBin::Bin/../../../lib";
13
14use Test::More (tests => 3);
15
16if (!caller()) {
17    main(@ARGV);
18}
19
20sub main {
21    my $CLASS = 'Fcm::Build::Fortran';
22    use_ok($CLASS);
23    my $util = $CLASS->new();
24    isa_ok($util, $CLASS);
25    test_extract_interface($util);
26}
27
28sub test_extract_interface {
29    my ($util) = @_;
30    my $root = ($0 =~ qr{\A(.+)\.t\z}msx)[0];
31    my $f90 = $root . '-extract-interface-source.f90';
32    my $f90_interface = $root . '-extract-interface-result.f90';
33    open(my($handle_for_source), '<', $f90) || die("$f90: $!");
34    my @actual_lines = $util->extract_interface($handle_for_source);
35    close($handle_for_source);
36    open(my($handle_for_result), '<', $f90_interface)
37        || die("$f90_interface: $!");
38    my @expected_lines = readline($handle_for_result);
39    close($handle_for_result);
40    is_deeply(\@actual_lines, \@expected_lines, 'extract_interface');
41}
42
43__END__
Note: See TracBrowser for help on using the repository browser.