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.
01-subtree.t in vendors/FCM-2017.10.0/t/fcm-commit – NEMO

source: vendors/FCM-2017.10.0/t/fcm-commit/01-subtree.t @ 11668

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

Reimport latest FCM release

File size: 3.7 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# Basic tests for "fcm commit".
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 3
26#-------------------------------------------------------------------------------
27setup
28init_repos
29init_branch sibling_branch_test $REPOS_URL
30init_branch_wc branch_test $REPOS_URL
31cd $TEST_DIR/wc
32FILE_LIST="./lib/python/info/__init__.py
33./lib/python/info/poems.py
34./module/hello_constants.f90
35./module/hello_constants.inc
36./module/hello_constants_dummy.inc
37"
38for FILE in $FILE_LIST; do
39    sed -i "s/for/FOR/g; s/fi/end if/g; s/in/IN/g;" $FILE
40    sed -i "/#/d; /^ *!/d" $FILE
41    sed -i "s/!/!!/g; s/q/\nq/g; s/[(]/(\n/g" $FILE
42done
43FILE_DIR=$(dirname $FILE)
44svn copy -q $FILE added_file
45svn copy -q $FILE_DIR added_directory
46svn delete --force -q $FILE_DIR
47#-------------------------------------------------------------------------------
48# Tests fcm commit
49TEST_KEY=$TEST_KEY_BASE
50export SVN_EDITOR="sed -i 1i\foo"
51cd program
52run_pass "$TEST_KEY" fcm commit --svn-non-interactive <<__IN__
53y
54__IN__
55commit_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
56file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
57$TEST_DIR/wc: working directory changed to top of working copy.
58[info] sed -i 1i\foo: starting commit message editor...
59Change summary:
60--------------------------------------------------------------------------------
61[Root   : $REPOS_URL]
62[Project: ${TEST_PROJECT:-}]
63[Branch : branches/dev/Share/branch_test]
64[Sub-dir: ]
65A  +    added_directory
66A  +    added_file
67D       module
68D       module/hello_constants.f90
69D       module/hello_constants.inc
70D       module/hello_constants_dummy.inc
71M       lib/python/info/poems.py
72M  +    added_directory/hello_constants.f90
73M  +    added_directory/hello_constants.inc
74M  +    added_directory/hello_constants_dummy.inc
75--------------------------------------------------------------------------------
76Commit message is as follows:
77--------------------------------------------------------------------------------
78foo
79--------------------------------------------------------------------------------
80*** WARNING: YOU ARE COMMITTING TO A Share BRANCH.
81*** Please ensure that you have the owner's permission.
82Would you like to commit this change?
83Enter "y" or "n" (or just press <return> for "n"): Adding         added_directory
84Adding         added_file
85Deleting       module
86Sending        added_directory/hello_constants.f90
87Sending        added_directory/hello_constants.inc
88Sending        added_directory/hello_constants_dummy.inc
89Sending        lib/python/info/poems.py
90Committed revision 6.
91Updating '.':
92At revision 6.
93__OUT__
94file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
95teardown
96#-------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.