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-simple.t in vendors/t/fcm-loc-layout – NEMO

source: vendors/t/fcm-loc-layout/00-simple.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: 5.3 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 status".
21#-------------------------------------------------------------------------------
22. $(dirname $0)/test_header
23#-------------------------------------------------------------------------------
24tests 24
25#-------------------------------------------------------------------------------
26setup
27unset TEST_PROJECT
28init_repos
29init_merge_branches merge1 merge2 $REPOS_URL
30export SVN_EDITOR="sed -i 1i\foo"
31cd $TEST_DIR/wc
32#-------------------------------------------------------------------------------
33# Tests fcm loc-layout, no project, default setup
34TEST_KEY=$TEST_KEY_BASE-no-project-default
35run_pass "$TEST_KEY" fcm loc-layout
36file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
37target: .
38url: $ROOT_URL/trunk@9
39root: $REPOS_URL
40path: /trunk
41peg_rev: 9
42project:
43branch: trunk
44branch_category: trunk
45sub_tree:
46__OUT__
47file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
48#-------------------------------------------------------------------------------
49# Tests fcm loc-layout, no project, default setup, cd to subdirectory
50TEST_KEY=$TEST_KEY_BASE-no-project-subtree
51cd module
52run_pass "$TEST_KEY" fcm loc-layout
53file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
54target: .
55url: $ROOT_URL/trunk/module@9
56root: $REPOS_URL
57path: /trunk/module
58peg_rev: 9
59project:
60branch: trunk
61branch_category: trunk
62sub_tree: module
63__OUT__
64file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
65cd ..
66#-------------------------------------------------------------------------------
67# Tests fcm loc-layout, no project, default setup, target subdirectory
68TEST_KEY=$TEST_KEY_BASE-no-project-target-subtree
69run_pass "$TEST_KEY" fcm loc-layout module
70file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
71target: module
72url: $ROOT_URL/trunk/module@9
73root: $REPOS_URL
74path: /trunk/module
75peg_rev: 9
76project:
77branch: trunk
78branch_category: trunk
79sub_tree: module
80__OUT__
81file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
82#-------------------------------------------------------------------------------
83# Tests fcm loc-layout, no project, default setup, target subdirectory
84TEST_KEY=$TEST_KEY_BASE-no-project-target-repos
85run_pass "$TEST_KEY" fcm loc-layout $REPOS_URL
86file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
87target: $REPOS_URL
88url: $ROOT_URL@9
89root: $REPOS_URL
90path:
91peg_rev: 9
92project:
93__OUT__
94file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
95teardown
96#-------------------------------------------------------------------------------
97setup
98init_repos_layout_roses
99svn checkout -q $ROOT_URL/a/a/0/0/0/trunk $TEST_DIR/wc
100cd $TEST_DIR/wc
101#-------------------------------------------------------------------------------
102# Tests fcm loc-layout, 'roses' 5-level project
103TEST_KEY=$TEST_KEY_BASE-roses-default
104run_pass "$TEST_KEY" fcm loc-layout
105file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
106target: .
107url: $ROOT_URL/a/a/0/0/0/trunk@3
108root: $REPOS_URL
109path: /a/a/0/0/0/trunk
110peg_rev: 3
111project: a/a/0/0/0
112branch: trunk
113branch_category: trunk
114sub_tree:
115__OUT__
116file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
117#-------------------------------------------------------------------------------
118# Tests fcm loc-layout, 'roses' 5-level project
119TEST_KEY=$TEST_KEY_BASE-roses-subtree
120cd module
121run_pass "$TEST_KEY" fcm loc-layout
122file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
123target: .
124url: $ROOT_URL/a/a/0/0/0/trunk/module@3
125root: $REPOS_URL
126path: /a/a/0/0/0/trunk/module
127peg_rev: 3
128project: a/a/0/0/0
129branch: trunk
130branch_category: trunk
131sub_tree: module
132__OUT__
133file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
134cd ..
135#-------------------------------------------------------------------------------
136# Tests fcm loc-layout, 'roses' 5-level project
137TEST_KEY=$TEST_KEY_BASE-roses-target-subtree
138run_pass "$TEST_KEY" fcm loc-layout module
139file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
140target: module
141url: $ROOT_URL/a/a/0/0/0/trunk/module@3
142root: $REPOS_URL
143path: /a/a/0/0/0/trunk/module
144peg_rev: 3
145project: a/a/0/0/0
146branch: trunk
147branch_category: trunk
148sub_tree: module
149__OUT__
150file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
151#-------------------------------------------------------------------------------
152# Tests fcm loc-layout, no project, default setup, target subdirectory
153TEST_KEY=$TEST_KEY_BASE-roses-target-repos
154run_pass "$TEST_KEY" fcm loc-layout $REPOS_URL
155file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<__OUT__
156target: $REPOS_URL
157url: $ROOT_URL@3
158root: $REPOS_URL
159path:
160peg_rev: 3
161__OUT__
162file_cmp "$TEST_KEY.err" "$TEST_KEY.err" </dev/null
163teardown
Note: See TracBrowser for help on using the repository browser.