source: build-files/ports-overlay/sysutils/grub2/files/patch-build-aux_test-driver @ 0eb4ff4

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 0eb4ff4 was 0eb4ff4, checked in by Kris Moore <kris@…>, 9 months ago

Add patch to fix breakage with newwer automake 1.14

  • Property mode set to 100644
File size: 4.1 KB
Line 
1--- build-aux/test-driver.o     2013-07-29 08:36:33.775875020 -0400
2+++ build-aux/test-driver       2013-07-29 08:35:04.085870311 -0400
3@@ -0,0 +1,127 @@
4+#! /bin/sh
5+# test-driver - basic testsuite driver script.
6+
7+scriptversion=2012-06-27.10; # UTC
8+
9+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
10+#
11+# This program is free software; you can redistribute it and/or modify
12+# it under the terms of the GNU General Public License as published by
13+# the Free Software Foundation; either version 2, or (at your option)
14+# any later version.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19+# GNU General Public License for more details.
20+#
21+# You should have received a copy of the GNU General Public License
22+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23+
24+# As a special exception to the GNU General Public License, if you
25+# distribute this file as part of a program that contains a
26+# configuration script generated by Autoconf, you may include it under
27+# the same distribution terms that you use for the rest of that program.
28+
29+# This file is maintained in Automake, please report
30+# bugs to <bug-automake@gnu.org> or send patches to
31+# <automake-patches@gnu.org>.
32+
33+# Make unconditional expansion of undefined variables an error.  This
34+# helps a lot in preventing typo-related bugs.
35+set -u
36+
37+usage_error ()
38+{
39+  echo "$0: $*" >&2
40+  print_usage >&2
41+  exit 2
42+}
43+
44+print_usage ()
45+{
46+  cat <<END
47+Usage:
48+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
49+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
50+              [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
51+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
52+END
53+}
54+
55+# TODO: better error handling in option parsing (in particular, ensure
56+# TODO: $log_file, $trs_file and $test_name are defined).
57+test_name= # Used for reporting.
58+log_file=  # Where to save the output of the test script.
59+trs_file=  # Where to save the metadata of the test run.
60+expect_failure=no
61+color_tests=no
62+enable_hard_errors=yes
63+while test $# -gt 0; do
64+  case $1 in
65+  --help) print_usage; exit $?;;
66+  --version) echo "test-driver $scriptversion"; exit $?;;
67+  --test-name) test_name=$2; shift;;
68+  --log-file) log_file=$2; shift;;
69+  --trs-file) trs_file=$2; shift;;
70+  --color-tests) color_tests=$2; shift;;
71+  --expect-failure) expect_failure=$2; shift;;
72+  --enable-hard-errors) enable_hard_errors=$2; shift;;
73+  --) shift; break;;
74+  -*) usage_error "invalid option: '$1'";;
75+  esac
76+  shift
77+done
78+
79+if test $color_tests = yes; then
80+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
81+  red='[0;31m' # Red.
82+  grn='[0;32m' # Green.
83+  lgn='[1;32m' # Light green.
84+  blu='[1;34m' # Blue.
85+  mgn='[0;35m' # Magenta.
86+  std='[m'     # No color.
87+else
88+  red= grn= lgn= blu= mgn= std=
89+fi
90+
91+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
92+trap "st=129; $do_exit" 1
93+trap "st=130; $do_exit" 2
94+trap "st=141; $do_exit" 13
95+trap "st=143; $do_exit" 15
96+
97+# Test script is run here.
98+"$@" >$log_file 2>&1
99+estatus=$?
100+if test $enable_hard_errors = no && test $estatus -eq 99; then
101+  estatus=1
102+fi
103+
104+case $estatus:$expect_failure in
105+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
106+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
107+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
108+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
109+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
110+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
111+esac
112+
113+# Report outcome to console.
114+echo "${col}${res}${std}: $test_name"
115+
116+# Register the test result, and other relevant metadata.
117+echo ":test-result: $res" > $trs_file
118+echo ":global-test-result: $res" >> $trs_file
119+echo ":recheck: $recheck" >> $trs_file
120+echo ":copy-in-global-log: $gcopy" >> $trs_file
121+
122+# Local Variables:
123+# mode: shell-script
124+# sh-indentation: 2
125+# eval: (add-hook 'write-file-hooks 'time-stamp)
126+# time-stamp-start: "scriptversion="
127+# time-stamp-format: "%:y-%02m-%02d.%02H"
128+# time-stamp-time-zone: "UTC"
129+# time-stamp-end: "; # UTC"
130+# End:
Note: See TracBrowser for help on using the repository browser.