#!/bin/bash # ------------------------------------------------------------------------------ # Copyright (C) 2006-2021 British Crown (Met Office) & Contributors. # # This file is part of FCM, tools for managing and building source code. # # FCM is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # FCM is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with FCM. If not, see . # ------------------------------------------------------------------------------ # Basic tests for "fcm add". #------------------------------------------------------------------------------- . $(dirname $0)/test_header if [[ $? -ne 0 ]]; then exit 1 fi #------------------------------------------------------------------------------- check_svn_version tests 24 #------------------------------------------------------------------------------- setup init_repos init_branch_wc add $REPOS_URL mkdir $TEST_DIR/wc/added_directory1 svn add -q $TEST_DIR/wc/added_directory1 touch $TEST_DIR/wc/added_directory1/added_file1 mkdir $TEST_DIR/wc/added_directory2 touch $TEST_DIR/wc/added_directory2/added_file2 cd $TEST_DIR/wc #------------------------------------------------------------------------------- # Tests fcm add unversioned file TEST_KEY=$TEST_KEY_BASE-fcm-add-file run_pass "$TEST_KEY" fcm add added_directory1/added_file1 file_cmp "$TEST_KEY.out" "$TEST_KEY.out" <<'__OUT__' A added_directory1/added_file1 __OUT__ file_cmp "$TEST_KEY.err" "$TEST_KEY.err" for "n"): A unversioned_file __OUT__ file_cmp "$TEST_KEY.err" "$TEST_KEY.err" for "n"): A unversioned_directory A unversioned_directory/unversioned_file_2 __OUT__ file_cmp "$TEST_KEY.err" "$TEST_KEY.err"