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