forked from itszor/gcc-6502-bits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.sh
executable file
·38 lines (31 loc) · 1.07 KB
/
check.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
#!/bin/bash
declare -a BOARDS
PARALLELISM=8
# DejaGNU's "schedule of variations" multi-board support appears to not be
# very useful for us, so just run one board at a time.
BOARDS=("semi65x-sim" "semi65cx-sim")
get_test_results_dir () {
local board=$1
local base
local n=1
base="testresults-$(date +%F)"
while [ -d "$base-$n" ]; do
n=$(( n + 1 ))
done
mkdir -p "$base-$n"
echo "$base-$n"
}
thisdir="$(dirname "$0")"
thisdir="$(readlink -f "$thisdir")"
resdir=$(get_test_results_dir)
for board in "${BOARDS[@]}"; do
pushd "$thisdir"/gcc-build-2 >& /dev/null
sed "s,BOARD_DIR_LOCATION,$thisdir/semi65x," < "$thisdir/semi65x/site-orig.exp" > "$thisdir/semi65x/site.exp"
export DEJAGNU="$thisdir/semi65x/site.exp"
export PATH="$thisdir/semi65x":$PATH
make -j "$PARALLELISM" check-gcc RUNTESTFLAGS="--target_board=$board $*"
popd >& /dev/null
echo "Copying results to $resdir/$board"
mkdir -p "$resdir"/"$board"
cp "$thisdir/gcc-build-2/gcc/testsuite/gcc/gcc.sum" "$thisdir/gcc-build-2/gcc/testsuite/gcc/gcc.log" "$resdir"/"$board"
done