10 test -r "$config" || die "usage: fate.sh <config>"
12 workdir=$(cd $(dirname $config) && pwd)
18 test -n "$slot" || die "slot not specified"
19 test -n "$repo" || die "repo not specified"
20 test -d "$samples" || die "samples location not specified"
26 (set -C; exec >$lock) 2>/dev/null || return
32 file:*|/*) src="${repo#file:}" ;;
33 git:*) git clone --quiet --branch "$branch" "$repo" "$src" ;;
40 git:*) git fetch --force && git reset --hard "origin/$branch" ;;
46 ${shell} ${src}/configure \
48 --samples="${samples}" \
50 --enable-memory-poisoning \
52 ${arch:+--arch=$arch} \
53 ${cpu:+--cpu="$cpu"} \
54 ${toolchain:+--toolchain="$toolchain"} \
55 ${cross_prefix:+--cross-prefix="$cross_prefix"} \
59 ${target_os:+--target-os="$target_os"} \
60 ${sysroot:+--sysroot="$sysroot"} \
61 ${target_exec:+--target-exec="$target_exec"} \
62 ${target_path:+--target-path="$target_path"} \
63 ${target_samples:+--target-samples="$target_samples"} \
64 ${extra_cflags:+--extra-cflags="$extra_cflags"} \
65 ${extra_ldflags:+--extra-ldflags="$extra_ldflags"} \
66 ${extra_libs:+--extra-libs="$extra_libs"} \
72 ${make} ${makeopts} && ${make} install
76 test "$build_only" = "yes" && return
78 ${make} ${makeopts} -k fate
82 rm -rf ${build} ${inst}
86 date=$(date -u +%Y%m%d%H%M%S)
87 echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
88 cat ${build}/config.fate >>report
89 cat ${build}/tests/data/fate/*.rep >>report || for i in ${build}/tests/data/fate/*.rep ; do cat "$i" >>report ; done
90 test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
99 mkdir -p ${workdir} || die "Error creating ${workdir}"
100 lock ${workdir} || die "${workdir} locked"
101 cd ${workdir} || die "cd ${workdir} failed"
104 : ${build:=${workdir}/build}
105 : ${inst:=${workdir}/install}
107 test -d "$src" && update || checkout || die "Error fetching source"
111 version=$(${src}/version.sh ${src})
112 test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
113 echo ${version} >version-$slot
115 rm -rf "${build}" *.log
118 configure >configure.log 2>&1 || fail 3 "error configuring"
119 compile >compile.log 2>&1 || fail 2 "error compiling"
120 fate >test.log 2>&1 || fail 1 "error testing"