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.
10-text.t in vendors/t/fcm-conflicts – NEMO

source: vendors/t/fcm-conflicts/10-text.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.6 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 conflicts" (text conflict following merge).
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24check_svn_version
25tests 11
26#-------------------------------------------------------------------------------
27setup
28init_repos
29init_merge_branches merge1 merge2 $REPOS_URL
30cd $TEST_DIR/wc
31#-------------------------------------------------------------------------------
32TEST_KEY=$TEST_KEY_BASE-merge
33export SVN_EDITOR="sed -i 1i\foo"
34echo "The End" >> lib/python/info/poems.py
35svn commit -m "Finish off the poem" -q
36svn update -q
37run_pass "$TEST_KEY" fcm merge --non-interactive $ROOT_URL/branches/dev/Share/merge1
38file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
39#-------------------------------------------------------------------------------
40TEST_KEY=$TEST_KEY_BASE-merge-status
41run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
42status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
43file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<'__OUT__'
44 M      .
45?       lib/python/info/poems.py.merge-left.r1
46?       lib/python/info/poems.py.merge-right.r5
47?       lib/python/info/poems.py.working
48?       unversioned_file
49A  +    added_directory
50A  +    added_file
51A  +    module/tree_conflict_file
52C       lib/python/info/poems.py
53M       module/hello_constants.f90
54M       module/hello_constants.inc
55M       module/hello_constants_dummy.inc
56M       subroutine/hello_sub_dummy.h
57Summary of conflicts:
58  Text conflicts: 1
59__OUT__
60file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
61#-------------------------------------------------------------------------------
62TEST_KEY=$TEST_KEY_BASE-merge-conflicts
63export FCM_GRAPHIC_MERGE=fcm-dummy-diff
64run_pass "$TEST_KEY" fcm conflicts <<'__IN__'
65y
66y
67__IN__
68file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
69[info] lib/python/info/poems.py: in text conflict.
70diff3 $PWD/lib/python/info/poems.py.working $PWD/lib/python/info/poems.py.merge-left.r1 $PWD/lib/python/info/poems.py.merge-right.r5
71====3
721:1,2c
732:1,2c
74  #!/usr/bin/env python
75  # -*- coding: utf-8 -*-
763:0a
77====3
781:6c
792:6c
80  It needs a doctor for its eyes,
813:4c
82  It needs a doctor FOR its eyes,
83====3
841:8,9c
852:8,9c
86  However, if you feel inclined
87  To get one (to improve your mind,
883:6,8c
89  However, if you feel INclINed
90  To get one (
91  to improve your mINd,
92====3
931:12c
942:12c
95  And when it flies into a rage
963:11c
97  And when it flies INto a rage
98====3
991:14c
1002:14c
101  I had an aunt in Yucatan
1023:13c
103  I had an aunt IN Yucatan
104====3
1051:16c
1062:16c
107  And kept it for a pet.
1083:15c
109  And kept it FOR a pet.
110====3
1111:19c
1122:19c
113  The Snake is living yet.
1143:18c
115  The Snake is livINg yet.
116====
1171:24,25c
118  print "\n",  __doc__
119  The End
1202:24c
121  print "\n",  __doc__
1223:23c
123  prINt "\n",  __doc__
124Run "svn resolve --accept working lib/python/info/poems.py"?
125Enter "y" or "n" (or just press <return> for "n") Resolved conflicted state of 'lib/python/info/poems.py'
126__OUT__
127file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
128#-------------------------------------------------------------------------------
129TEST_KEY=$TEST_KEY_BASE-merge-conflicts-status
130run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
131status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
132file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<'__OUT__'
133 M      .
134?       unversioned_file
135A  +    added_directory
136A  +    added_file
137A  +    module/tree_conflict_file
138M       lib/python/info/poems.py
139M       module/hello_constants.f90
140M       module/hello_constants.inc
141M       module/hello_constants_dummy.inc
142M       subroutine/hello_sub_dummy.h
143__OUT__
144file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
Note: See TracBrowser for help on using the repository browser.