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.
36-build-fail-cont-basic.t in vendors/t/fcm-make – NEMO

source: vendors/t/fcm-make/36-build-fail-cont-basic.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: 6.3 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 "fcm make", build, continue on failure.
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23
24task_lines_from_log() {
25    sed '
26        /\[\(info\|FAIL\)\] \(compile\+\?\|ext-iface\|install\|link\)  *\(----\|[0-9][0-9]*\.[0-9][0-9]*\) /!d
27        s/  [0-9][0-9]*\.[0-9][0-9]* / ???? /
28    ' fcm-make.log
29}
30
31fail_lines_from_log() {
32    sed '/\[FAIL\] !/!d' fcm-make.log
33}
34
35#-------------------------------------------------------------------------------
36tests 12
37#-------------------------------------------------------------------------------
38cp -r $TEST_SOURCE_DIR/$TEST_KEY_BASE/* .
39#-------------------------------------------------------------------------------
40# Break hello1 and hello2
41TEST_KEY="$TEST_KEY_BASE-1-2-bad"
42sed -i 's/implicit none/implicit non/' src/greet_mod.f90  # introduce typo
43run_fail "$TEST_KEY" fcm make --new
44task_lines_from_log >"$TEST_KEY-log-tasks"
45file_cmp "$TEST_KEY-log-tasks" "$TEST_KEY-log-tasks" <<'__LOG__'
46[info] compile   ???? M world_mod.o          <- world_mod.f90
47[FAIL] compile   ???? ! greet_mod.o          <- greet_mod.f90
48[FAIL] compile   ---- ! hello2.o             <- hello2.f90
49[info] compile   ???? M hello_sub.o          <- hello_sub.f90
50[info] ext-iface ???? M hello_sub.interface  <- hello_sub.f90
51[info] compile   ???? M hello3.o             <- hello3.f90
52[info] link      ???? M hello3               <- hello3.f90
53[info] compile   ???? M hello4.o             <- hello4.f90
54[info] link      ???? M hello4               <- hello4.f90
55__LOG__
56fail_lines_from_log >"$TEST_KEY-log-fails"
57file_cmp "$TEST_KEY-log-fails" "$TEST_KEY-log-fails" <<'__LOG__'
58[FAIL] ! greet_mod.mod       : depends on failed target: greet_mod.o
59[FAIL] ! greet_mod.o         : update task failed
60[FAIL] ! hello2              : depends on failed target: hello2.o
61[FAIL] ! hello2.o            : depends on failed target: greet_mod.mod
62__LOG__
63
64TEST_KEY="$TEST_KEY_BASE-1-2-fix"
65sed -i 's/implicit non/implicit none/' src/greet_mod.f90  # fix typo
66run_pass "$TEST_KEY" fcm make
67task_lines_from_log >"$TEST_KEY-log-tasks"
68file_cmp "$TEST_KEY-log-tasks" "$TEST_KEY-log-tasks" <<'__LOG__'
69[info] compile   ---- U world_mod.o          <- world_mod.f90
70[info] compile   ???? M greet_mod.o          <- greet_mod.f90
71[info] compile   ???? M hello.o              <- hello.f90
72[info] link      ???? M hello                <- hello.f90
73[info] compile   ???? M hello2.o             <- hello2.f90
74[info] link      ???? M hello2               <- hello2.f90
75[info] compile   ---- U hello_sub.o          <- hello_sub.f90
76[info] ext-iface ---- U hello_sub.interface  <- hello_sub.f90
77[info] compile   ---- U hello3.o             <- hello3.f90
78[info] link      ---- U hello3               <- hello3.f90
79[info] compile   ---- U hello4.o             <- hello4.f90
80[info] link      ---- U hello4               <- hello4.f90
81__LOG__
82fail_lines_from_log >"$TEST_KEY-log-fails"
83file_cmp "$TEST_KEY-log-fails" "$TEST_KEY-log-fails" </dev/null
84#-------------------------------------------------------------------------------
85# Break hello3 and hello4
86TEST_KEY="$TEST_KEY_BASE-3-4-bad"
87sed -i 's/implicit none/implicit non/' src/hello_sub.f90  # introduce typo
88run_fail "$TEST_KEY" fcm make --new
89task_lines_from_log >"$TEST_KEY-log-tasks"
90file_cmp "$TEST_KEY-log-tasks" "$TEST_KEY-log-tasks" <<'__LOG__'
91[info] compile   ???? M world_mod.o          <- world_mod.f90
92[info] compile   ???? M greet_mod.o          <- greet_mod.f90
93[info] compile   ???? M hello.o              <- hello.f90
94[info] link      ???? M hello                <- hello.f90
95[info] compile   ???? M hello2.o             <- hello2.f90
96[info] link      ???? M hello2               <- hello2.f90
97[FAIL] compile   ???? ! hello_sub.o          <- hello_sub.f90
98[info] ext-iface ???? M hello_sub.interface  <- hello_sub.f90
99[info] compile   ???? M hello3.o             <- hello3.f90
100[FAIL] link      ---- ! hello3               <- hello3.f90
101[info] compile   ???? M hello4.o             <- hello4.f90
102[FAIL] link      ---- ! hello4               <- hello4.f90
103__LOG__
104fail_lines_from_log >"$TEST_KEY-log-fails"
105file_cmp "$TEST_KEY-log-fails" "$TEST_KEY-log-fails" <<'__LOG__'
106[FAIL] ! hello3              : depends on failed target: hello_sub.o
107[FAIL] ! hello4              : depends on failed target: hello_sub.o
108[FAIL] ! hello_sub.o         : update task failed
109__LOG__
110
111TEST_KEY="$TEST_KEY_BASE-3-4-fix"
112sed -i 's/implicit non/implicit none/' src/hello_sub.f90  # fix typo
113run_pass "$TEST_KEY" fcm make
114task_lines_from_log >"$TEST_KEY-log-tasks"
115file_cmp "$TEST_KEY-log-tasks" "$TEST_KEY-log-tasks" <<'__LOG__'
116[info] compile   ---- U world_mod.o          <- world_mod.f90
117[info] compile   ---- U greet_mod.o          <- greet_mod.f90
118[info] compile   ---- U hello.o              <- hello.f90
119[info] link      ---- U hello                <- hello.f90
120[info] compile   ---- U hello2.o             <- hello2.f90
121[info] link      ---- U hello2               <- hello2.f90
122[info] compile   ???? M hello_sub.o          <- hello_sub.f90
123[info] ext-iface ???? U hello_sub.interface  <- hello_sub.f90
124[info] compile   ---- U hello3.o             <- hello3.f90
125[info] link      ???? M hello3               <- hello3.f90
126[info] compile   ---- U hello4.o             <- hello4.f90
127[info] link      ???? M hello4               <- hello4.f90
128__LOG__
129fail_lines_from_log >"$TEST_KEY-log-fails"
130file_cmp "$TEST_KEY-log-fails" "$TEST_KEY-log-fails" </dev/null
131#-------------------------------------------------------------------------------
132exit 0
Note: See TracBrowser for help on using the repository browser.