]>
git.saurik.com Git - bison.git/blob - examples/calc++/test
3 # Copyright (C) 2005-2012 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 test -z "$VERBOSE" && {
25 # Number of the current test.
28 # Exit status of this script.
31 # run EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
32 # ---------------------------------------------------------
35 # Effective and expected exit status.
40 .
/calc
++ "$@" input
>out_eff
42 local out_eff
=`cat out_eff`
43 if test $sta_eff -eq $sta_exp; then
44 if test "$out_eff" = "$out_exp"; then
45 printf "$me: PASS: %2d\n" $number
47 printf "$me: FAIL: %2d (expected output: %s, effective: %s\n" \
48 $number "$out_exp" "$out_eff"
52 printf "$me: FAIL: %2d (expected status: %d, effective: %d\n" \
53 $number $sta_exp $sta_eff
56 number
=`expr $number + 1`