diff --git a/tests/ahci_test.in b/tests/ahci_test.in
index 70646a24e..ffb7cf48d 100644
--- a/tests/ahci_test.in
+++ b/tests/ahci_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/asn1_test.in b/tests/asn1_test.in
index 8f18ee6bb..a9b82dd0e 100644
--- a/tests/asn1_test.in
+++ b/tests/asn1_test.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/btrfs_test.in b/tests/btrfs_test.in
index a07d2e5d1..84cfd95d8 100644
--- a/tests/btrfs_test.in
+++ b/tests/btrfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/cdboot_test.in b/tests/cdboot_test.in
index f00cdec58..ec8943b16 100644
--- a/tests/cdboot_test.in
+++ b/tests/cdboot_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/core_compress_test.in b/tests/core_compress_test.in
index 24a811418..0b97c9557 100644
--- a/tests/core_compress_test.in
+++ b/tests/core_compress_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/cpio_test.in b/tests/cpio_test.in
index 5742cf17b..fb468564a 100644
--- a/tests/cpio_test.in
+++ b/tests/cpio_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if ! which cpio >/dev/null 2>&1; then
echo "cpio not installed; cannot test cpio."
diff --git a/tests/ehci_test.in b/tests/ehci_test.in
index bf823a5de..7aff6df94 100644
--- a/tests/ehci_test.in
+++ b/tests/ehci_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/erofs_test.in b/tests/erofs_test.in
index 436468dac..e3f3ea5eb 100644
--- a/tests/erofs_test.in
+++ b/tests/erofs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/example_scripted_test.in b/tests/example_scripted_test.in
index 783b7f138..0f32c79fa 100644
--- a/tests/example_scripted_test.in
+++ b/tests/example_scripted_test.in
@@ -1,4 +1,4 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
true
diff --git a/tests/exfat_test.in b/tests/exfat_test.in
index 7acde1977..ae2b209a1 100644
--- a/tests/exfat_test.in
+++ b/tests/exfat_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/ext234_test.in b/tests/ext234_test.in
index c9a8c1056..2f8aafc9c 100644
--- a/tests/ext234_test.in
+++ b/tests/ext234_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/f2fs_test.in b/tests/f2fs_test.in
index a020a0f96..4d16c2fab 100644
--- a/tests/f2fs_test.in
+++ b/tests/f2fs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/fat_test.in b/tests/fat_test.in
index 77e3f16c6..0e4b1ebae 100644
--- a/tests/fat_test.in
+++ b/tests/fat_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/fddboot_test.in b/tests/fddboot_test.in
index 6ef49efcb..74d2bcd87 100644
--- a/tests/fddboot_test.in
+++ b/tests/fddboot_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/file_filter_test.in b/tests/file_filter_test.in
index 18324f1a0..54fcf8e88 100644
--- a/tests/file_filter_test.in
+++ b/tests/file_filter_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
index 4903ad6cc..359c624fc 100644
--- a/tests/grub_cmd_date.in
+++ b/tests/grub_cmd_date.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/grub_cmd_regexp.in b/tests/grub_cmd_regexp.in
index 6520bd6d7..13633bb05 100644
--- a/tests/grub_cmd_regexp.in
+++ b/tests/grub_cmd_regexp.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
# Run GRUB script in a Qemu instance
# Copyright (C) 2010 Free Software Foundation, Inc.
diff --git a/tests/grub_cmd_set_date.in b/tests/grub_cmd_set_date.in
index 17673cd8a..5572535fa 100644
--- a/tests/grub_cmd_set_date.in
+++ b/tests/grub_cmd_set_date.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in
index 1a57fb388..2da9d722e 100644
--- a/tests/grub_cmd_sleep.in
+++ b/tests/grub_cmd_sleep.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/grub_cmd_test.in b/tests/grub_cmd_test.in
index 043c3a634..a78a5d6ee 100644
--- a/tests/grub_cmd_test.in
+++ b/tests/grub_cmd_test.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
# create a randome file
empty="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/grub_func_test.in b/tests/grub_func_test.in
index 1fa3c4352..6065ff6df 100644
--- a/tests/grub_func_test.in
+++ b/tests/grub_func_test.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/grub_script_blanklines.in b/tests/grub_script_blanklines.in
index bd8735491..9b84782c3 100644
--- a/tests/grub_script_blanklines.in
+++ b/tests/grub_script_blanklines.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
@builddir@/grub-script-check <.
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in
index 764e0da1c..76704c379 100644
--- a/tests/hddboot_test.in
+++ b/tests/hddboot_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/help_test.in b/tests/help_test.in
index 9c8ca52c8..ca3d7f31b 100644
--- a/tests/help_test.in
+++ b/tests/help_test.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/hfs_test.in b/tests/hfs_test.in
index c916b9bac..fc0e0e75c 100644
--- a/tests/hfs_test.in
+++ b/tests/hfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/hfsplus_test.in b/tests/hfsplus_test.in
index cb36a3661..7918a68bb 100644
--- a/tests/hfsplus_test.in
+++ b/tests/hfsplus_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/iso9660_test.in b/tests/iso9660_test.in
index 793664c87..7a6816f94 100644
--- a/tests/iso9660_test.in
+++ b/tests/iso9660_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if ! which xorriso >/dev/null 2>&1; then
echo "xorriso not installed; cannot test iso9660."
diff --git a/tests/jfs_test.in b/tests/jfs_test.in
index 86f9ebeaa..b1c18e9b1 100644
--- a/tests/jfs_test.in
+++ b/tests/jfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/luks1_test.in b/tests/luks1_test.in
index 0bfb53c98..3344746c1 100644
--- a/tests/luks1_test.in
+++ b/tests/luks1_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/luks2_test.in b/tests/luks2_test.in
index 49db47380..5368698f8 100644
--- a/tests/luks2_test.in
+++ b/tests/luks2_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/lzocompress_test.in b/tests/lzocompress_test.in
index 42e270df0..50145dd0c 100644
--- a/tests/lzocompress_test.in
+++ b/tests/lzocompress_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/minixfs_test.in b/tests/minixfs_test.in
index 78577fec8..0d28a7226 100644
--- a/tests/minixfs_test.in
+++ b/tests/minixfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/netboot_test.in b/tests/netboot_test.in
index 510c9c34b..b8a5f9abb 100644
--- a/tests/netboot_test.in
+++ b/tests/netboot_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/nilfs2_test.in b/tests/nilfs2_test.in
index 719972f53..84b8b1a0b 100644
--- a/tests/nilfs2_test.in
+++ b/tests/nilfs2_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/ntfs_test.in b/tests/ntfs_test.in
index da73c59f9..5b1bebe16 100644
--- a/tests/ntfs_test.in
+++ b/tests/ntfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/ohci_test.in b/tests/ohci_test.in
index a40d3bc0a..1652b7efc 100644
--- a/tests/ohci_test.in
+++ b/tests/ohci_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/partmap_test.in b/tests/partmap_test.in
index 9810cc1ac..8e12cf7ec 100644
--- a/tests/partmap_test.in
+++ b/tests/partmap_test.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
# Copyright (C) 2010 Free Software Foundation, Inc.
#
diff --git a/tests/pata_test.in b/tests/pata_test.in
index 4d0e7d573..6c2fa43dd 100644
--- a/tests/pata_test.in
+++ b/tests/pata_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/pseries_test.in b/tests/pseries_test.in
index 9b4090cf5..a1dd1670a 100644
--- a/tests/pseries_test.in
+++ b/tests/pseries_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/reiserfs_test.in b/tests/reiserfs_test.in
index 36e34c305..48d3ab4cc 100644
--- a/tests/reiserfs_test.in
+++ b/tests/reiserfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/romfs_test.in b/tests/romfs_test.in
index 98bb50c32..2c66cde34 100644
--- a/tests/romfs_test.in
+++ b/tests/romfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if ! which genromfs >/dev/null 2>&1; then
echo "genromfs not installed; cannot test romfs."
diff --git a/tests/serial_test.in b/tests/serial_test.in
index 48655d4b9..331c3c3ad 100644
--- a/tests/serial_test.in
+++ b/tests/serial_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/squashfs_test.in b/tests/squashfs_test.in
index 2f044f95d..b973f7bac 100644
--- a/tests/squashfs_test.in
+++ b/tests/squashfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if ! which mksquashfs >/dev/null 2>&1; then
echo "mksquashfs not installed; cannot test squashfs."
diff --git a/tests/syslinux_test.in b/tests/syslinux_test.in
index 44d3cdf7a..e81c15310 100644
--- a/tests/syslinux_test.in
+++ b/tests/syslinux_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
outfile="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/tar_test.in b/tests/tar_test.in
index 6e2f2de8b..eafb6649d 100644
--- a/tests/tar_test.in
+++ b/tests/tar_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if ! which tar >/dev/null 2>&1; then
echo "tar not installed; cannot test tar."
diff --git a/tests/test_sha512sum.in b/tests/test_sha512sum.in
index b2bd89609..3866f40c8 100644
--- a/tests/test_sha512sum.in
+++ b/tests/test_sha512sum.in
@@ -1,5 +1,5 @@
#! @BUILD_SHEBANG@
-set -e
+set -ex
# create a randome file
file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
diff --git a/tests/udf_test.in b/tests/udf_test.in
index 8968fb103..b84d0b674 100644
--- a/tests/udf_test.in
+++ b/tests/udf_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/uhci_test.in b/tests/uhci_test.in
index de199a281..46de98d92 100644
--- a/tests/uhci_test.in
+++ b/tests/uhci_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/xfs_test.in b/tests/xfs_test.in
index 8a648aa4a..d6b3ab908 100644
--- a/tests/xfs_test.in
+++ b/tests/xfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`
diff --git a/tests/xzcompress_test.in b/tests/xzcompress_test.in
index cfc6ccba6..f0ac52e2d 100644
--- a/tests/xzcompress_test.in
+++ b/tests/xzcompress_test.in
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see .
-set -e
+set -ex
grubshell=@builddir@/grub-shell
. "@builddir@/grub-core/modinfo.sh"
diff --git a/tests/zfs_test.in b/tests/zfs_test.in
index c8bb7937f..e1cb766a5 100644
--- a/tests/zfs_test.in
+++ b/tests/zfs_test.in
@@ -1,6 +1,6 @@
#!@BUILD_SHEBANG@
-set -e
+set -ex
if [ "x$EUID" = "x" ] ; then
EUID=`id -u`