New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Fortran.t in branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/EXTERNAL/fcm/t/Fcm/Build – NEMO

source: branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/EXTERNAL/fcm/t/Fcm/Build/Fortran.t @ 8733

Last change on this file since 8733 was 8733, checked in by dancopsey, 6 years ago

Remove svn keywords.

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.