1 |
commit: ef08daac0af2f3f617e38e80686121e87d491dfb |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 17 14:18:13 2018 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 17 14:20:22 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef08daac |
7 |
|
8 |
sys-devel/binutils: Semi-fix 2.31 gold testsuite |
9 |
|
10 |
https://sourceware.org/ml/binutils/2018-07/msg00225.html |
11 |
|
12 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
13 |
|
14 |
sys-devel/binutils/binutils-2.31.ebuild | 3 + |
15 |
sys-devel/binutils/files/binutils-2.31-test-driver | 148 +++++++++++++++++++++ |
16 |
2 files changed, 151 insertions(+) |
17 |
|
18 |
diff --git a/sys-devel/binutils/binutils-2.31.ebuild b/sys-devel/binutils/binutils-2.31.ebuild |
19 |
index a2e72661a56..eff39eb37c2 100644 |
20 |
--- a/sys-devel/binutils/binutils-2.31.ebuild |
21 |
+++ b/sys-devel/binutils/binutils-2.31.ebuild |
22 |
@@ -100,6 +100,9 @@ src_unpack() { |
23 |
} |
24 |
|
25 |
src_prepare() { |
26 |
+ # this file is missing in the 2.31 tarball, affects gold testsuite |
27 |
+ cp "${FILESDIR}/${P}-test-driver" "${S}/test-driver" || die |
28 |
+ |
29 |
if [[ ! -z ${PATCH_VER} ]] ; then |
30 |
einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}" |
31 |
eapply "${WORKDIR}/patch"/*.patch |
32 |
|
33 |
diff --git a/sys-devel/binutils/files/binutils-2.31-test-driver b/sys-devel/binutils/files/binutils-2.31-test-driver |
34 |
new file mode 100755 |
35 |
index 00000000000..0218a01f616 |
36 |
--- /dev/null |
37 |
+++ b/sys-devel/binutils/files/binutils-2.31-test-driver |
38 |
@@ -0,0 +1,148 @@ |
39 |
+#! /bin/sh |
40 |
+# test-driver - basic testsuite driver script. |
41 |
+ |
42 |
+scriptversion=2016-01-11.22; # UTC |
43 |
+ |
44 |
+# Copyright (C) 2011-2017 Free Software Foundation, Inc. |
45 |
+# |
46 |
+# This program is free software; you can redistribute it and/or modify |
47 |
+# it under the terms of the GNU General Public License as published by |
48 |
+# the Free Software Foundation; either version 2, or (at your option) |
49 |
+# any later version. |
50 |
+# |
51 |
+# This program is distributed in the hope that it will be useful, |
52 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
53 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
54 |
+# GNU General Public License for more details. |
55 |
+# |
56 |
+# You should have received a copy of the GNU General Public License |
57 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
58 |
+ |
59 |
+# As a special exception to the GNU General Public License, if you |
60 |
+# distribute this file as part of a program that contains a |
61 |
+# configuration script generated by Autoconf, you may include it under |
62 |
+# the same distribution terms that you use for the rest of that program. |
63 |
+ |
64 |
+# This file is maintained in Automake, please report |
65 |
+# bugs to <bug-automake@×××.org> or send patches to |
66 |
+# <automake-patches@×××.org>. |
67 |
+ |
68 |
+# Make unconditional expansion of undefined variables an error. This |
69 |
+# helps a lot in preventing typo-related bugs. |
70 |
+set -u |
71 |
+ |
72 |
+usage_error () |
73 |
+{ |
74 |
+ echo "$0: $*" >&2 |
75 |
+ print_usage >&2 |
76 |
+ exit 2 |
77 |
+} |
78 |
+ |
79 |
+print_usage () |
80 |
+{ |
81 |
+ cat <<END |
82 |
+Usage: |
83 |
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH |
84 |
+ [--expect-failure={yes|no}] [--color-tests={yes|no}] |
85 |
+ [--enable-hard-errors={yes|no}] [--] |
86 |
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] |
87 |
+The '--test-name', '--log-file' and '--trs-file' options are mandatory. |
88 |
+END |
89 |
+} |
90 |
+ |
91 |
+test_name= # Used for reporting. |
92 |
+log_file= # Where to save the output of the test script. |
93 |
+trs_file= # Where to save the metadata of the test run. |
94 |
+expect_failure=no |
95 |
+color_tests=no |
96 |
+enable_hard_errors=yes |
97 |
+while test $# -gt 0; do |
98 |
+ case $1 in |
99 |
+ --help) print_usage; exit $?;; |
100 |
+ --version) echo "test-driver $scriptversion"; exit $?;; |
101 |
+ --test-name) test_name=$2; shift;; |
102 |
+ --log-file) log_file=$2; shift;; |
103 |
+ --trs-file) trs_file=$2; shift;; |
104 |
+ --color-tests) color_tests=$2; shift;; |
105 |
+ --expect-failure) expect_failure=$2; shift;; |
106 |
+ --enable-hard-errors) enable_hard_errors=$2; shift;; |
107 |
+ --) shift; break;; |
108 |
+ -*) usage_error "invalid option: '$1'";; |
109 |
+ *) break;; |
110 |
+ esac |
111 |
+ shift |
112 |
+done |
113 |
+ |
114 |
+missing_opts= |
115 |
+test x"$test_name" = x && missing_opts="$missing_opts --test-name" |
116 |
+test x"$log_file" = x && missing_opts="$missing_opts --log-file" |
117 |
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" |
118 |
+if test x"$missing_opts" != x; then |
119 |
+ usage_error "the following mandatory options are missing:$missing_opts" |
120 |
+fi |
121 |
+ |
122 |
+if test $# -eq 0; then |
123 |
+ usage_error "missing argument" |
124 |
+fi |
125 |
+ |
126 |
+if test $color_tests = yes; then |
127 |
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. |
128 |
+ red='[0;31m' # Red. |
129 |
+ grn='[0;32m' # Green. |
130 |
+ lgn='[1;32m' # Light green. |
131 |
+ blu='[1;34m' # Blue. |
132 |
+ mgn='[0;35m' # Magenta. |
133 |
+ std='[m' # No color. |
134 |
+else |
135 |
+ red= grn= lgn= blu= mgn= std= |
136 |
+fi |
137 |
+ |
138 |
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' |
139 |
+trap "st=129; $do_exit" 1 |
140 |
+trap "st=130; $do_exit" 2 |
141 |
+trap "st=141; $do_exit" 13 |
142 |
+trap "st=143; $do_exit" 15 |
143 |
+ |
144 |
+# Test script is run here. |
145 |
+"$@" >$log_file 2>&1 |
146 |
+estatus=$? |
147 |
+ |
148 |
+if test $enable_hard_errors = no && test $estatus -eq 99; then |
149 |
+ tweaked_estatus=1 |
150 |
+else |
151 |
+ tweaked_estatus=$estatus |
152 |
+fi |
153 |
+ |
154 |
+case $tweaked_estatus:$expect_failure in |
155 |
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; |
156 |
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;; |
157 |
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; |
158 |
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; |
159 |
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; |
160 |
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; |
161 |
+esac |
162 |
+ |
163 |
+# Report the test outcome and exit status in the logs, so that one can |
164 |
+# know whether the test passed or failed simply by looking at the '.log' |
165 |
+# file, without the need of also peaking into the corresponding '.trs' |
166 |
+# file (automake bug#11814). |
167 |
+echo "$res $test_name (exit status: $estatus)" >>$log_file |
168 |
+ |
169 |
+# Report outcome to console. |
170 |
+echo "${col}${res}${std}: $test_name" |
171 |
+ |
172 |
+# Register the test result, and other relevant metadata. |
173 |
+echo ":test-result: $res" > $trs_file |
174 |
+echo ":global-test-result: $res" >> $trs_file |
175 |
+echo ":recheck: $recheck" >> $trs_file |
176 |
+echo ":copy-in-global-log: $gcopy" >> $trs_file |
177 |
+ |
178 |
+# Local Variables: |
179 |
+# mode: shell-script |
180 |
+# sh-indentation: 2 |
181 |
+# eval: (add-hook 'write-file-hooks 'time-stamp) |
182 |
+# time-stamp-start: "scriptversion=" |
183 |
+# time-stamp-format: "%:y-%02m-%02d.%02H" |
184 |
+# time-stamp-time-zone: "UTC0" |
185 |
+# time-stamp-end: "; # UTC" |
186 |
+# End: |