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 status". |
---|
21 | #------------------------------------------------------------------------------- |
---|
22 | . $(dirname $0)/test_header |
---|
23 | #------------------------------------------------------------------------------- |
---|
24 | check_svn_version |
---|
25 | tests 4 |
---|
26 | #------------------------------------------------------------------------------- |
---|
27 | setup |
---|
28 | init_repos |
---|
29 | init_merge_branches merge1 merge2 $REPOS_URL |
---|
30 | export SVN_EDITOR="sed -i 1i\foo" |
---|
31 | cd $TEST_DIR/wc |
---|
32 | #------------------------------------------------------------------------------- |
---|
33 | # Tests the setup for fcm status testing |
---|
34 | svn switch -q $ROOT_URL/trunk |
---|
35 | touch added_file |
---|
36 | svn add -q added_file |
---|
37 | svn commit -q -m "trunk modifications" |
---|
38 | svn update -q |
---|
39 | TEST_KEY=$TEST_KEY_BASE-setup |
---|
40 | run_pass "$TEST_KEY" fcm merge --non-interactive branches/dev/Share/merge1 |
---|
41 | rm subroutine/hello_sub.h |
---|
42 | svn delete -q --force lib/python/info/poems.py |
---|
43 | #------------------------------------------------------------------------------- |
---|
44 | # Tests fcm status result of fcm merge (1) |
---|
45 | TEST_KEY=$TEST_KEY_BASE-status |
---|
46 | run_pass "$TEST_KEY" fcm status --config-dir=$TEST_DIR/.subversion |
---|
47 | status_sort "$TEST_DIR/$TEST_KEY.out" "$TEST_DIR/$TEST_KEY.sorted.out" |
---|
48 | file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__ |
---|
49 | M . |
---|
50 | A + added_directory |
---|
51 | C added_file |
---|
52 | > local file obstruction, incoming file add upon merge |
---|
53 | D lib/python/info/poems.py |
---|
54 | M module/hello_constants.f90 |
---|
55 | M module/hello_constants.inc |
---|
56 | M module/hello_constants_dummy.inc |
---|
57 | A + module/tree_conflict_file |
---|
58 | ! subroutine/hello_sub.h |
---|
59 | M subroutine/hello_sub_dummy.h |
---|
60 | ? unversioned_file |
---|
61 | Summary of conflicts: |
---|
62 | Tree conflicts: 1 |
---|
63 | __OUT__ |
---|
64 | file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null |
---|
65 | #------------------------------------------------------------------------------- |
---|