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.
00-simple.t in vendors/FCM-2017.10.0/t/fcm-switch – NEMO

source: vendors/FCM-2017.10.0/t/fcm-switch/00-simple.t @ 11668

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

Reimport latest FCM release

File size: 4.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# Basic tests for "fcm switch".
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 12
26#-------------------------------------------------------------------------------
27setup
28init_repos
29init_merge_branches merge1 merge2 $REPOS_URL
30export SVN_EDITOR="sed -i 1i\foo"
31cd $TEST_DIR/wc
32#-------------------------------------------------------------------------------
33# Tests fcm switch trunk
34svn switch -q $ROOT_URL/branches/dev/Share/merge1
35TEST_KEY=$TEST_KEY_BASE-trunk
36run_pass "$TEST_KEY" fcm switch trunk <<<"y"
37merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
38file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
39switch: status of "$TEST_DIR/wc":
40?       unversioned_file
41switch: continue?
42Enter "y" or "n" (or just press <return> for "n"):
43D    added_directory
44D    added_file
45D    module/tree_conflict_file
46U    lib/python/info/__init__.py
47U    lib/python/info/poems.py
48U    module/hello_constants.f90
49U    module/hello_constants.inc
50U    module/hello_constants_dummy.inc
51U    subroutine/hello_sub_dummy.h
52Updated to revision 9.
53__OUT__
54file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
55#-------------------------------------------------------------------------------
56# Tests fcm switch merge1 branch
57rm unversioned_file
58TEST_KEY=$TEST_KEY_BASE-branch-1
59run_pass "$TEST_KEY" fcm switch branches/dev/Share/merge1 <<<'y'
60merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
61file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
62A    added_directory
63A    added_directory/hello_constants.f90
64A    added_directory/hello_constants.inc
65A    added_directory/hello_constants_dummy.inc
66A    added_file
67A    module/tree_conflict_file
68U    lib/python/info/__init__.py
69U    lib/python/info/poems.py
70U    module/hello_constants.f90
71U    module/hello_constants.inc
72U    module/hello_constants_dummy.inc
73U    subroutine/hello_sub_dummy.h
74Updated to revision 9.
75__OUT__
76file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
77#-------------------------------------------------------------------------------
78# Tests fcm switch merge2 branch
79TEST_KEY=$TEST_KEY_BASE-branch-2
80run_pass "$TEST_KEY" fcm switch --non-interactive dev/Share/merge2
81merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
82file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
83 U   subroutine/hello_sub.h
84A    renamed_added_file
85D    added_directory
86D    added_file
87D    module/tree_conflict_file
88U    lib/python/info/poems.py
89U    module/hello_constants.f90
90U    module/hello_constants.inc
91U    module/hello_constants_dummy.inc
92U    subroutine/hello_sub_dummy.h
93Updated to revision 9.
94__OUT__
95file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
96#-------------------------------------------------------------------------------
97# Tests fcm switch trunk, without .svn/entries
98TEST_KEY=$TEST_KEY_BASE-trunk-2
99rm -f .svn/entries
100run_pass "$TEST_KEY" fcm switch trunk <<<'y'
101merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
102file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<'__OUT__'
103 U   subroutine/hello_sub.h
104D    renamed_added_file
105U    lib/python/info/__init__.py
106Updated to revision 9.
107__OUT__
108file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
109#-------------------------------------------------------------------------------
110teardown
111exit
Note: See TracBrowser for help on using the repository browser.