Commit de80d53e authored by Matthias Braun's avatar Matthias Braun
Browse files

factor out common code of nightly scripts, fix 2006 syntax error

parent 99050046
#!/bin/bash
set -eu
function die() {
echo "$@" 1>&2
exit 1
}
ME="$(readlink -f "$0")"
MYDIR="$(dirname "$ME")"
TARGET_TRIPLE="$1"
test -n "$TARGET_TRIPLE" || die "No target triple specified"
. setup.sh
# Check if cparser is available
CPARSER=$(readlink -f "${MYDIR}/../../cparser/build/debug/cparser") || die "cparser missing"
test -x "${CPARSER}" || die "cparser missing (expected at ${CPARSER})"
# Synchronize spec files
SOURCE="firm@i44sun3:/data1/firm/specinst"
DESTDIR="/data1/$(whoami)"
rsync -rsh=ssh -z --delete --recursive --links "$SOURCE" "${DESTDIR}/" || die "rsync failed"
cd "${DESTDIR}/specinst"
# 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"
SPEC_PY_FLAGS="--c-compiler=${CPARSER} --no-cpp --no-fortran --iterations=1"
# Start spec differently on each architecture
case "$TARGET_TRIPLE" in
"i686-linux-gnu")
SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=1800"
SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=3600"
;;
"sparc-leon-linux-gnu")
SPEC_PY_FLAGS="$SPEC_PY_FLAGS --time-limit=5400"
......@@ -55,23 +28,4 @@ case "$TARGET_TRIPLE" in
;;
esac
${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
. runspec.sh
#!/bin/bash
set -eu
function die() {
echo "$@" 1>&2
exit 1
}
ME="$(readlink -f "$0")"
MYDIR="$(dirname "$ME")"
TARGET_TRIPLE="$1"
test -n "$TARGET_TRIPLE" || die "No target triple specified"
. setup.sh
# Check if cparser is available
CPARSER=$(readlink -f "${MYDIR}/../../cparser/build/debug/cparser") || die "cparser missing"
test -x "${CPARSER}" || die "cparser missing (expected at ${CPARSER})"
# Synchronize spec files
SOURCE="firm@i44sun3:/data1/firm/specinst-2006"
DESTDIR="/data1/$(whoami)"
rsync -rsh=ssh -z --delete --recursive --links "$SOURCE" "${DESTDIR}/" || die "rsync failed"
cd "${DESTDIR}/specinst-2006"
# 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}"
ln -sf "${RESDIR}" result
SPEC_PY_FLAGS="--c-compiler=${CPARSER} --no-cpp --no-fortran --iterations=1"
# Start spec differently on each architecture
......@@ -43,23 +16,4 @@ case "$TARGET_TRIPLE" in
;;
esac
${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
. runspec.sh
# Synchronize spec files
echo -n "rsycn..."
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
set -eu
function die() {
echo "$@" 1>&2
exit 1
}
ME="$(readlink -f "$0")"
MYDIR="$(dirname "$ME")"
test -n "${1-}" || die "No target triple specified"
TARGET_TRIPLE="$1"
# Check if cparser is available
CPARSER=$(readlink -f "${MYDIR}/../../cparser/build/debug/cparser") || die "cparser missing"
test -x "${CPARSER}" || die "cparser missing (expected at ${CPARSER})"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment