]> git.proxmox.com Git - grub2.git/blame - tests/grub_script_blockarg.in
bump version to 2.06-13+pmx2
[grub2.git] / tests / grub_script_blockarg.in
CommitLineData
a827807a 1#! @BUILD_SHEBANG@
67a9e4d9
BC
2
3# Run GRUB script in a Qemu instance
4# Copyright (C) 2010 Free Software Foundation, Inc.
5#
6# GRUB is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# GRUB is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
18
19error_if_not () {
20 if test "$1" != "$2"; then
21 echo "[$1]" != "[$2]"
22 exit 1
23 fi
24}
25
26cmd='test_blockarg { true }'
27v=`echo "$cmd" | @builddir@/grub-shell`
28error_if_not "$v" '{ true }'
29
b65ea155 30tmp=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
67a9e4d9
BC
31cmd='test_blockarg { test_blockarg { true } }'
32echo "$cmd" | @builddir@/grub-shell >$tmp
33error_if_not "`head -n1 $tmp|tail -n1`" '{ test_blockarg { true } }'
34error_if_not "`head -n2 $tmp|tail -n1`" '{ true }'
35
36cmd='test_blockarg { test_blockarg { test_blockarg { true } }; test_blockarg { true } }'
37echo "$cmd" | @builddir@/grub-shell >$tmp
38error_if_not "`head -n1 $tmp|tail -n1`" '{ test_blockarg { test_blockarg { true } }; test_blockarg { true } }'
39error_if_not "`head -n2 $tmp|tail -n1`" '{ test_blockarg { true } }'
40error_if_not "`head -n3 $tmp|tail -n1`" '{ true }'
41error_if_not "`head -n4 $tmp|tail -n1`" '{ true }'