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.
45-dest-mv.t in vendors/t/fcm-make – NEMO

source: vendors/t/fcm-make/45-dest-mv.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.1 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", destination moved.
21#-------------------------------------------------------------------------------
22. "$(dirname "$0")/test_header"
23
24tests 9
25
26mkdir -p 'src/hello'
27cat >'src/hello/hello.f90' <<'__FORTRAN__'
28program hello
29use greet_mod, only: greet
30use world_mod, only: world
31write(*, '(a,1x,a)') greet, world
32end program hello
33__FORTRAN__
34cat >'src/hello/world_mod.f90' <<'__FORTRAN__'
35module world_mod
36character(*), parameter :: world = 'Earth'
37end module world_mod
38__FORTRAN__
39cat >'src/hello/greet_mod.f90' <<'__FORTRAN__'
40module greet_mod
41character(*), parameter :: greet = 'Hello'
42end module greet_mod
43__FORTRAN__
44
45svnadmin create 'hello.svn'
46URL="file://${PWD}/hello.svn/hello"
47svn import --no-auth-cache -m'initial import' 'src' "${URL}/trunk/src"
48
49mkdir -p 'loc1'
50cat >'loc1/fcm-make.cfg' <<__CFG__
51steps=extract build
52extract.ns=hello
53extract.location{primary}[hello]=${URL}
54build.target{task}=link
55build.prop{file-ext.bin}=
56__CFG__
57#-------------------------------------------------------------------------------
58run_pass "${TEST_KEY_BASE}-1" fcm make -C "${PWD}/loc1"
59mv "${PWD}/loc1" "${PWD}/loc2"
60#-------------------------------------------------------------------------------
61# Inherit
62mkdir -p 'loc3'
63cat >'loc3/fcm-make.cfg' <<__CFG__
64use=${PWD}/loc2
65__CFG__
66run_pass "${TEST_KEY_BASE}-3" fcm make -C "${PWD}/loc3"
67LOG="${PWD}/loc3/fcm-make.log"
68file_grep "${TEST_KEY_BASE}-3-log-1" \
69    '\[info\]   dest:    3 \[U unchanged\]' "${LOG}"
70file_grep "${TEST_KEY_BASE}-3-log-2" \
71    '\[info\] sources: total=3, analysed=0' "${LOG}"
72file_grep "${TEST_KEY_BASE}-3-log-3" \
73    '\[info\] TOTAL     targets: modified=0, unchanged=6, failed=0' "${LOG}"
74#-------------------------------------------------------------------------------
75# Incremental
76run_pass "${TEST_KEY_BASE}-2" fcm make -C "${PWD}/loc2"
77LOG="${PWD}/loc2/fcm-make.log"
78file_grep "${TEST_KEY_BASE}-2-log-1" \
79    '\[info\]   dest:    3 \[U unchanged\]' "${LOG}"
80file_grep "${TEST_KEY_BASE}-2-log-2" \
81    '\[info\] sources: total=3, analysed=0' "${LOG}"
82file_grep "${TEST_KEY_BASE}-2-log-3" \
83    '\[info\] TOTAL     targets: modified=0, unchanged=6, failed=0' "${LOG}"
84#-------------------------------------------------------------------------------
85exit
Note: See TracBrowser for help on using the repository browser.