source: LMDZ6/branches/Amaury_dev/tools/fcm/t/fcm-conflicts/10-text.t @ 5095

Last change on this file since 5095 was 5095, checked in by abarral, 4 months ago

Revert cosp*/ from the trunk, as it's external code
Add missing bits from FCM2 source

File size: 4.8 KB
Line 
1#!/bin/bash
2# ------------------------------------------------------------------------------
3# Copyright (C) 2006-2021 British Crown (Met Office) & Contributors.
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_filtered "$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"?
125#IF SVN1.8/9 Enter "y" or "n" (or just press <return> for "n") Resolved conflicted state of 'lib/python/info/poems.py'
126#IF SVN1.10/14 Enter "y" or "n" (or just press <return> for "n") Merge conflicts in 'lib/python/info/poems.py' marked as resolved.
127__OUT__
128file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
129#-------------------------------------------------------------------------------
130TEST_KEY=$TEST_KEY_BASE-merge-conflicts-status
131run_pass "$TEST_KEY" svn status --config-dir=$TEST_DIR/.subversion/
132status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out"
133file_cmp "$TEST_KEY.sorted.out" "$TEST_KEY.sorted.out" <<'__OUT__'
134 M      .
135?       unversioned_file
136A  +    added_directory
137A  +    added_file
138A  +    module/tree_conflict_file
139M       lib/python/info/poems.py
140M       module/hello_constants.f90
141M       module/hello_constants.inc
142M       module/hello_constants_dummy.inc
143M       subroutine/hello_sub_dummy.h
144__OUT__
145file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
Note: See TracBrowser for help on using the repository browser.