runspec.sh 1.03 KB
Newer Older
1
# Synchronize spec files
Manuel Mohr's avatar
Manuel Mohr committed
2
echo -n "rsync..."
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
DESTDIR="/data1/$(whoami)"
rsync -rsh=ssh -z --delete --recursive --links "$SOURCE" "${DESTDIR}/" || die "rsync failed"
echo "ok"

COMPLETEDEST="${DESTDIR}/$(basename "${SOURCE}")"

cd "${COMPLETEDEST}"
# Need to call "relocate" if the spec stuff ended up in a different directory
# than the original installation
(set +eu ; . shrc && bin/relocate)
# Setup result directory
rm -rf result # remove old symlink
RESDIR="/ben/firm/public_html/nightly_spec_results/${TARGET_TRIPLE}"
mkdir -p "${RESDIR}" || dir "Couldn't setup result dir"
ln -sf "${RESDIR}" result || die "Couldn't setup result dir"

${MYDIR}/../spec.py --config-only $SPEC_PY_FLAGS > config/default.cfg
(set +eu ; . shrc && runspec | tee log.txt)

# Error handling
#function handler() {
#	killall -q -9 -g runspec
#	killall -q -9 -g specinvoke
#	killall -q -9 cparser
#}
#SPEC_PY=$!
#trap handler TERM KILL EXIT INT
#wait $SPEC_PY

# Grep for errors in the output
ERR=$(grep --count Error log.txt) || true

if [ $ERR -ne 0 ]; then
	exit 1
fi
exit 0