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/t/fcm-switch – NEMO

source: vendors/t/fcm-switch/01-subtree.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: 4.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# Basic tests for "fcm switch".
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 9
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
36cd module
37run_pass "$TEST_KEY" fcm switch trunk <<__IN__
38y
39__IN__
40merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
41file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
42switch: status of "$TEST_DIR/wc":
43?       $TEST_DIR/wc/unversioned_file
44switch: continue?
45Enter "y" or "n" (or just press <return> for "n"):
46D    $TEST_DIR/wc/added_directory
47D    $TEST_DIR/wc/added_file
48D    tree_conflict_file
49U    $TEST_DIR/wc/lib/python/info/__init__.py
50U    $TEST_DIR/wc/lib/python/info/poems.py
51U    $TEST_DIR/wc/subroutine/hello_sub_dummy.h
52U    hello_constants.f90
53U    hello_constants.inc
54U    hello_constants_dummy.inc
55Updated to revision 9.
56__OUT__
57file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
58#-------------------------------------------------------------------------------
59# Tests fcm switch merge1 branch
60rm ../unversioned_file
61TEST_KEY=$TEST_KEY_BASE-branch-1
62run_pass "$TEST_KEY" fcm switch branches/dev/Share/merge1 <<__IN__
63y
64__IN__
65merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
66file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
67A    $TEST_DIR/wc/added_directory
68A    $TEST_DIR/wc/added_directory/hello_constants.f90
69A    $TEST_DIR/wc/added_directory/hello_constants.inc
70A    $TEST_DIR/wc/added_directory/hello_constants_dummy.inc
71A    $TEST_DIR/wc/added_file
72A    tree_conflict_file
73U    $TEST_DIR/wc/lib/python/info/__init__.py
74U    $TEST_DIR/wc/lib/python/info/poems.py
75U    $TEST_DIR/wc/subroutine/hello_sub_dummy.h
76U    hello_constants.f90
77U    hello_constants.inc
78U    hello_constants_dummy.inc
79Updated to revision 9.
80__OUT__
81file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
82#-------------------------------------------------------------------------------
83# Tests fcm switch merge2 branch
84TEST_KEY=$TEST_KEY_BASE-branch-2
85run_pass "$TEST_KEY" fcm switch --non-interactive dev/Share/merge2
86merge_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
87file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<__OUT__
88 U   $TEST_DIR/wc/subroutine/hello_sub.h
89A    $TEST_DIR/wc/renamed_added_file
90D    $TEST_DIR/wc/added_directory
91D    $TEST_DIR/wc/added_file
92D    tree_conflict_file
93U    $TEST_DIR/wc/lib/python/info/poems.py
94U    $TEST_DIR/wc/subroutine/hello_sub_dummy.h
95U    hello_constants.f90
96U    hello_constants.inc
97U    hello_constants_dummy.inc
98Updated to revision 9.
99__OUT__
100file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
101teardown
102#-------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.