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-branch.t in vendors/FCM-2017.10.0/t/svn-username – NEMO

source: vendors/FCM-2017.10.0/t/svn-username/00-branch.t @ 10672

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

Reimport latest FCM release

File size: 3.9 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# Test "fcm branch-create" and "fcm branch-list", alternate username.
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24setup
25init_repos
26cd $TEST_DIR
27svn cp -m 't1' --parents -q \
28    $ROOT_URL/trunk@1 $ROOT_URL/branches/dev/barn.owl/r1_wing
29if ! svnserve -r $TEST_DIR -d --pid-file pid-file; then
30    if [[ -s pid-file ]]; then
31        kill $(cat pid-file)
32    fi
33    skip_all 'svnserve failed'
34    teardown
35    exit
36fi
37tests 9
38#-------------------------------------------------------------------------------
39# Tests fcm branch-create, alternate username
40TEST_KEY="$TEST_KEY_BASE"
41FCM_SUBVERSION_SERVERS_CONF="$PWD/$TEST_KEY-svn-servers-conf"
42cat >$FCM_SUBVERSION_SERVERS_CONF <<'__CONF__'
43[groups]
44bar=localhost
45
46[bar]
47username=barn.owl
48__CONF__
49SVN_EDITOR=true \
50FCM_SUBVERSION_SERVERS_CONF=$FCM_SUBVERSION_SERVERS_CONF run_pass "$TEST_KEY" \
51    fcm branch-create hello svn://localhost/test_repos <<<'n'
52echo >>"$TEST_KEY.out" # Insert newline
53file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
54[info] Source: svn://localhost/test_repos/trunk@1 (4)
55[info] true: starting commit message editor...
56Change summary:
57--------------------------------------------------------------------------------
58A    svn://localhost/test_repos/branches/dev/barn.owl/r1_hello
59--------------------------------------------------------------------------------
60Commit message is as follows:
61--------------------------------------------------------------------------------
62Created /branches/dev/barn.owl/r1_hello from /trunk@1.
63--------------------------------------------------------------------------------
64Create the branch?
65Enter "y" or "n" (or just press <return> for "n")
66__OUT__
67file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
68#-------------------------------------------------------------------------------
69TEST_KEY=$TEST_KEY_BASE-1
70FCM_SUBVERSION_SERVERS_CONF="$PWD/$TEST_KEY-svn-servers-conf"
71cat >$FCM_SUBVERSION_SERVERS_CONF <<'__CONF__'
72[groups]
73bar=localhost
74
75[bar]
76username=barn.owl
77__CONF__
78FCM_SUBVERSION_SERVERS_CONF=$FCM_SUBVERSION_SERVERS_CONF run_pass "$TEST_KEY" \
79    fcm branch-list svn://localhost/test_repos
80file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<'__OUT__'
81[info] svn://localhost/test_repos@4: 1 match(es)
82svn://localhost/test_repos/branches/dev/barn.owl/r1_wing@4
83__OUT__
84file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
85#-------------------------------------------------------------------------------
86TEST_KEY=$TEST_KEY_BASE-0
87cat >$FCM_SUBVERSION_SERVERS_CONF <<'__CONF__'
88[groups]
89bar=localhost
90
91[bar]
92username=honey.bee
93__CONF__
94FCM_SUBVERSION_SERVERS_CONF=$FCM_SUBVERSION_SERVERS_CONF run_pass "$TEST_KEY" \
95    fcm branch-list svn://localhost/test_repos
96file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<'__OUT__'
97[info] svn://localhost/test_repos@4: 0 match(es)
98__OUT__
99file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
100#-------------------------------------------------------------------------------
101kill $(cat pid-file)
102teardown
103exit
Note: See TracBrowser for help on using the repository browser.