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.
03-build-include-paths.t in vendors/t/fcm-make – NEMO

source: vendors/t/fcm-make/03-build-include-paths.t @ 10669

Last change on this file since 10669 was 10669, checked in by nicolasmartin, 5 years ago

Import latest FCM release from Github into the repository for testing

File size: 3.5 KB
Line 
1#!/bin/bash
2#-------------------------------------------------------------------------------
3# (C) British Crown Copyright 2006-17 Met Office.
4#
5# This file is part of FCM, tools for managing and building source code.
6#
7# FCM is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# FCM is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with FCM. If not, see <http://www.gnu.org/licenses/>.
19#-------------------------------------------------------------------------------
20# Tests for "fcm make", "build.prop{fc.include-paths}".
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23
24function get_compiler_log() {
25    sed '/^\[info\] shell(0.*) gfortran/!d;
26         /hello\.exe/d;
27         s/^\[info\] shell(0.*) //' .fcm-make/log
28}
29#-------------------------------------------------------------------------------
30tests 11
31cp -r $TEST_SOURCE_DIR/$TEST_KEY_BASE/* .
32#-------------------------------------------------------------------------------
33TEST_KEY="$TEST_KEY_BASE-control"
34run_fail "$TEST_KEY" fcm make
35#-------------------------------------------------------------------------------
36TEST_KEY="$TEST_KEY_BASE"
37FCM_TEST_FC_INCLUDE_PATHS="$PWD/include/world1 $PWD/include/world2" \
38    run_pass "$TEST_KEY" fcm make
39$PWD/build/bin/hello.exe >"$TEST_KEY.command.out"
40file_cmp "$TEST_KEY.command.out" "$TEST_KEY.command.out" <<<'Hello Earth'
41get_compiler_log >"$TEST_KEY.gfortran.log"
42file_cmp "$TEST_KEY.gfortran.log" "$TEST_KEY.gfortran.log" <<__LOG__
43gfortran -oo/world.o -c -I./include -I$PWD/include/world1 -I$PWD/include/world2 $PWD/src/world.f90
44gfortran -oo/hello.o -c -I./include -I$PWD/include/world1 -I$PWD/include/world2 $PWD/src/hello.f90
45__LOG__
46#-------------------------------------------------------------------------------
47TEST_KEY="$TEST_KEY_BASE-incr0"
48find build -type f -exec stat -c'%Y %n' {} \; | sort >"$TEST_KEY.mtime.old"
49FCM_TEST_FC_INCLUDE_PATHS="$PWD/include/world1 $PWD/include/world2" \
50    run_pass "$TEST_KEY" fcm make
51find build -type f -exec stat -c'%Y %n' {} \; | sort >"$TEST_KEY.mtime"
52file_cmp "$TEST_KEY.mtime" "$TEST_KEY.mtime.old" "$TEST_KEY.mtime"
53$PWD/build/bin/hello.exe >"$TEST_KEY.command.out"
54file_cmp "$TEST_KEY.command.out" "$TEST_KEY.command.out" <<<'Hello Earth'
55get_compiler_log >"$TEST_KEY.gfortran.log"
56file_cmp "$TEST_KEY.gfortran.log" "$TEST_KEY.gfortran.log" </dev/null
57#-------------------------------------------------------------------------------
58TEST_KEY="$TEST_KEY_BASE-incr1"
59FCM_TEST_FC_INCLUDE_PATHS="$PWD/include/world2 $PWD/include/world1" \
60    run_pass "$TEST_KEY" fcm make
61$PWD/build/bin/hello.exe >"$TEST_KEY.command.out"
62file_cmp "$TEST_KEY.command.out" "$TEST_KEY.command.out" <<<'Hello Moon'
63get_compiler_log >"$TEST_KEY.gfortran.log"
64file_cmp "$TEST_KEY.gfortran.log" "$TEST_KEY.gfortran.log" <<__LOG__
65gfortran -oo/world.o -c -I./include -I$PWD/include/world2 -I$PWD/include/world1 $PWD/src/world.f90
66gfortran -oo/hello.o -c -I./include -I$PWD/include/world2 -I$PWD/include/world1 $PWD/src/hello.f90
67__LOG__
68#-------------------------------------------------------------------------------
69exit 0
Note: See TracBrowser for help on using the repository browser.