forked from foss-for-synopsys-dwc-arc-processors/toolchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-uclibc-tests.sh
executable file
·240 lines (199 loc) · 5.79 KB
/
run-uclibc-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#!/bin/sh
# Copyright (C) 2012-2015 Synopsys Inc.
# Contributor Jeremy Bennett <[email protected]>
# This file is a master script for building ARC tool chains.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# SCRIPT TO RUN ARC-UCLIBC-LINUX REGRESSION TESTS
# ===============================================
# Usage:
# ./run-uclibc-tests.sh
# The following environment variables must be supplied
# RELEASE
# The number of the current ARC tool chain release.
# LOGDIR
# Directory for all log files.
# RESDIR
# Directory for all results directories.
# ARC_GNU
# The directory containing all the sources. If not set, this will default
# to the directory containing this script.
# ARC_ENDIAN
# "little" or "big"
# PARALLEL
# string "-j <jobs> -l <load>" to control parallel make.
# ARC_TEST_BOARD_UCLIBC
# The Dejagnu board description for the target. This must be a standard
# DejaGnu baseboard, or in the dejagnu/baseboards directory of the
# toolchain repository.
# ARC_TEST_ADDR_UCLIBC
# The IP address for the target if required by the board. Used by the
# underlying DejaGnu scripts.
# ARC_MULTILIB_OPTIONS
# May be used by the underlying DejaGnu scripts to specify options for
# multilib testing.
# DO_BINUTILS
# DO_GAS
# DO_LD
# DO_GCC
# DO_LIBGCC
# DO_LIBGLOSS
# DO_NEWLIB
# DO_LIBSTDCPP
# DO_SIM
# DO_GDB
# Specify whether the corresponding test should be run.
# Result is 0 if successful, 1 otherwise.
# Standard setup
. "${ARC_GNU}"/toolchain/arc-init.sh
# Run UCLIBC regression and gather results. Gathering results is a separate
# function because of the variation in the location and number of results
# files for each tool.
DEJAGNU=${ARC_GNU}/toolchain/site.exp
export DEJAGNU
echo "Running uClibc Linux tests"
# Create the uClibc log file and results directory
logfile_uclibc="${LOGDIR}/uclibc-check-$(date -u +%F-%H%M).log"
rm -f "${logfile_uclibc}"
res_uclibc="${RESDIR}/uclibc-results-$(date -u +%F-%H%M)"
mkdir ${res_uclibc}
readme=${res_uclibc}/README
# Location of some files depends on endianess
if [ "${ARC_ENDIAN}" = "little" ]
then
bd_uclibc=${ARC_GNU}/bd-${RELEASE}-uclibc
target_dir=arc-snps-linux-uclibc
else
bd_uclibc=${ARC_GNU}/bd-${RELEASE}-uclibceb
target_dir=arceb-snps-linux-uclibc
fi
# Create a file of start up commands for GDB
commfile="${ARC_GNU}/commfile"
echo "set sysroot /opt/arc-4.4-gdb-7.5/arc-linux-uclibc" >${commfile}
ARC_GDB_COMMFILE=${commfile}
export ARC_GDB_COMMFILE
# Create a README with info about the test
echo "Test of UCLIBC tool chain run" > ${readme}
echo "=============================" >> ${readme}
echo "" >> ${readme}
echo "Start time: $(date -u +%d\ %b\ %Y\ at\ %H:%M)" >> ${readme}
echo "Tool chain release: ${RELEASE}" >> ${readme}
echo "Endianness: ${ARC_ENDIAN}" >> ${readme}
echo "Test board: ${ARC_TEST_BOARD_UCLIBC}" >> ${readme}
echo "Test IP address: ${ARC_TEST_ADDR_UCLIBC}" >> ${readme}
echo "Multilib options: ${ARC_MULTILIB_OPTIONS}" >> ${readme}
echo "Commfile contents:" >> ${readme}
${SED} < ${commfile} -e 's/^/ /' >> ${readme}
# Run tests
status=0
# binutils
if [ "x${DO_BINUTILS}" = "xyes" ]
then
run_check ${bd_uclibc} \
binutils \
"${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
binutils/binutils \
"${logfile_uclibc}" \
|| status=1
fi
# gas
if [ "x${DO_GAS}" = "xyes" ]
then
run_check ${bd_uclibc} \
gas "${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
gas/testsuite/gas \
"${logfile_uclibc}" \
|| status=1
fi
# ld
if [ "x${DO_LD}" = "xyes" ]
then
run_check ${bd_uclibc} \
ld "${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
ld/ld \
"${logfile_uclibc}" \
|| status=1
fi
# gcc and g++
if [ "x${DO_GCC}" = "xyes" ]
then
run_check ${bd_uclibc} \
gcc \
"${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
gcc/testsuite/gcc/gcc \
"${logfile_uclibc}" \
|| status=1
echo "Testing g++..."
save_res ${bd_uclibc} \
${res_uclibc} \
gcc/testsuite/g++/g++ \
"${logfile_uclibc}" \
|| status=1
fi
# libgcc
if [ "x${DO_LIBGCC}" = "xyes" ]
then
run_check ${bd_uclibc} \
target-libgcc \
"${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
${target_dir}/libgcc/testsuite/libgcc \
"${logfile_uclibc}" \
|| status=1
fi
# libstdc++
if [ "x${DO_LIBSTDCPP}" = "xyes" ]
then
run_check ${bd_uclibc} \
target-libstdc++-v3 \
"${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
${target_dir}/libstdc++-v3/testsuite/libstdc++ \
"${logfile_uclibc}" \
|| status=1
fi
# gdb
if [ "x${DO_GDB}" = "xyes" ]
then
run_check ${bd_uclibc} \
gdb "${logfile_uclibc}" \
${ARC_TEST_BOARD_UCLIBC} \
|| status=1
save_res ${bd_uclibc} \
${res_uclibc} \
gdb/testsuite/gdb \
"${logfile_uclibc}" \
|| status=1
fi
exit ${status}
# vim: noexpandtab sts=4 ts=8: