1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
# t440 --- co -p -w
#
# Copyright (C) 2010-2022 Thien-Thi Nguyen
#
# This program 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.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
. $srcdir/common
. $srcdir/common-kn
split_std_out_err no
$hey echo ' -*- org -*-'
$hey type co
##
# Do "co -p -wAUTHOR" for various values of AUTHOR,
# on various branches. Check output and diagnostics.
##
prep_b_comparison
coerr=$wd/co.err
doubt=$wd/diff.out
tip1=1.9
tip111=1.1.1.7
tip161=1.6.1.2
xfail ()
{
# $1 -- author login
# $2 -- source (valid branch or revision number)
# $3+ -- expected diagnostic
who=$1
source=$2
shift ; shift
badmsg="$@"
$hey echo "* xfail: $who $source"
cmd="co -p$source -w$who"
$cmd $v 1> $actual 2> $coerr \
&& problem "unexpected exit value (success): $cmd"
noiselessness_rules $actual "$cmd"
grep -F "$badmsg" $coerr \
|| problem "unexpected diagnostic output: $cmd"
}
xfail_brnum ()
{
# $1 -- author login
# $2 -- branch number
who=$1
brnum=$2
xfail $who $brnum "No revision on branch $brnum has author $who."
}
xfail_revno ()
{
# $1 -- author login
# $2 -- revision number
who=$1
revno=$2
tip_varname=`echo tip$revno | sed 's/[.]//g'`
eval tip='$'$tip_varname
xfail $who $revno "Revision $tip has author ttn."
}
xpass ()
{
# $1 -- STEM in fake/b.d/STEM.cou
# $2 -- author login
# $3 -- source (valid branch or revision number)
expected=`bundled_commav b.d/$1.cou`
who=$2
source=$3
cmd="co -p$source -w$who"
$hey echo "* xpass: $who $source"
must '$cmd $v 1> $actual 2> $coerr'
normalize_b_and_diff "$cmd"
}
##
# * First, try an author that is not in the RCS file.
##
xfail_brnum nobody 1
xfail_revno nobody 1.
xfail_brnum nobody 1.1.1
xfail_revno nobody 1.1.1.
xfail_brnum nobody 1.6.1
xfail_revno nobody 1.6.1.
##
# * Next, try an author that is only one branch.
##
xpass 14 zurg 1
xfail_revno zurg 1.
xpass 14 zurg 1.4
xpass 13 zurg 1.3
xfail_brnum zurg 1.1.1
xfail_revno zurg 1.1.1.
xfail_brnum zurg 1.6.1
xfail_revno zurg 1.6.1.
##
# * Last, try an author that is everywhere.
##
xpass 19 ttn 1
xpass 19 ttn 1.
xpass 1117 ttn 1.1.1
xpass 1117 ttn 1.1.1.
xpass 1612 ttn 1.6.1
xpass 1612 ttn 1.6.1.
exit 0
# t440 ends here
|