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.
29-relative-cfg.t in vendors/t/fcm-make – NEMO

source: vendors/t/fcm-make/29-relative-cfg.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.0 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", config as relative paths
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23
24clean() {
25    rm -fr \
26        .fcm-make \
27        build \
28        fcm-make-as-parsed.cfg \
29        fcm-make-on-success.cfg \
30        fcm-make.log
31}
32#-------------------------------------------------------------------------------
33tests 11
34#-------------------------------------------------------------------------------
35TEST_KEY="$TEST_KEY_BASE"
36
37mkdir etc
38cat >etc/fcm-make.cfg <<'__CFG__'
39steps=build
40build.source=$HERE/../src
41build.target=hello.exe
42__CFG__
43
44mkdir src
45cat >src/hello.f90 <<'__FORTRAN__'
46program hello
47write(*, '(a)') 'Hello World!'
48end program hello
49__FORTRAN__
50
51#-------------------------------------------------------------------------------
52clean
53run_fail "$TEST_KEY-control" fcm make
54file_cmp "$TEST_KEY-control.err" "$TEST_KEY-control.err" <<'__ERROR__'
55[FAIL] no configuration specified or found
56
57__ERROR__
58#-------------------------------------------------------------------------------
59clean
60run_pass "$TEST_KEY-pwd" fcm make -f etc/fcm-make.cfg
61file_test "$TEST_KEY.hello.exe" $PWD/build/bin/hello.exe
62$PWD/build/bin/hello.exe >"$TEST_KEY.hello.exe.out"
63file_cmp "$TEST_KEY.hello.exe.out" "$TEST_KEY.hello.exe.out" <<'__OUT__'
64Hello World!
65__OUT__
66#-------------------------------------------------------------------------------
67clean
68run_pass "$TEST_KEY-path" fcm make -F $PWD/etc
69file_test "$TEST_KEY.hello.exe" $PWD/build/bin/hello.exe
70$PWD/build/bin/hello.exe >"$TEST_KEY.hello.exe.out"
71file_cmp "$TEST_KEY.hello.exe.out" "$TEST_KEY.hello.exe.out" <<'__OUT__'
72Hello World!
73__OUT__
74#-------------------------------------------------------------------------------
75clean
76cd src
77run_pass "$TEST_KEY-path" fcm make -C .. -f etc/fcm-make.cfg
78file_test "$TEST_KEY.hello.exe" ../build/bin/hello.exe
79../build/bin/hello.exe >"$TEST_KEY.hello.exe.out"
80file_cmp "$TEST_KEY.hello.exe.out" "$TEST_KEY.hello.exe.out" <<'__OUT__'
81Hello World!
82__OUT__
83cd ..
84#-------------------------------------------------------------------------------
85exit 0
Note: See TracBrowser for help on using the repository browser.