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"
25 : ${build:=${workdir}/build}
26 : ${inst:=${workdir}/install}
31 --samples="${samples}"
32 ${ignore_tests:+--ignore-tests="$ignore_tests"}
33 ${arch:+--arch="$arch"}
35 ${toolchain:+--toolchain="$toolchain"}
36 ${cross_prefix:+--cross-prefix="$cross_prefix"}
40 ${target_os:+--target-os="$target_os"}
41 ${sysroot:+--sysroot="$sysroot"}
42 ${target_exec:+--target-exec="$target_exec"}
43 ${target_path:+--target-path="$target_path"}
44 ${target_samples:+--target-samples="$target_samples"}
45 ${extra_cflags:+--extra-cflags="$extra_cflags"}
46 ${extra_ldflags:+--extra-ldflags="$extra_ldflags"}
47 ${extra_libs:+--extra-libs="$extra_libs"}
53 (set -C; exec >$lock) 2>/dev/null || return
59 file:*|/*) src="${repo#file:}" ;;
60 git:*) git clone --quiet --branch "$branch" "$repo" "$src" ;;
67 git:*) git fetch --quiet --force; git reset --quiet --hard "origin/$branch" ;;
73 eval ${src}/configure ${configuration}
78 ${make} ${makeopts} && ${make} install
82 test "$build_only" = "yes" && return
84 ${make} ${makeopts_fate-${makeopts}} -k fate
88 rm -rf ${build} ${inst}
92 date=$(date -u +%Y%m%d%H%M%S)
93 echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
94 if test -e ${build}/avbuild/config.fate; then
95 cat ${build}/avbuild/config.fate >> report 2> /dev/null
97 eval echo config:failed:failed:failed:failed:failed:${configuration} >> report 2> /dev/null
99 cat ${build}/tests/data/fate/*.rep >> report 2> /dev/null
100 test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
109 mkdir -p ${workdir} || die "Error creating ${workdir}"
110 lock ${workdir} || die "${workdir} locked"
111 cd ${workdir} || die "cd ${workdir} failed"
113 test -d "$src" && update || checkout || die "Error fetching source"
117 version=$(${src}/avbuild/version.sh ${src})
118 test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0
119 echo ${version} >version-$slot
121 rm -rf "${build}" *.log
124 configure >configure.log 2>&1 || fail $? "error configuring"
125 compile >compile.log 2>&1 || fail $? "error compiling"
126 fate >test.log 2>&1 || fail $? "error testing"