Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

runall.sh


#!/bin/bash

SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 || exit ; pwd -P )"
cd "$SCRIPTPATH" || exit


# we are in /somepath/benchmarks/ and want to add
# /somepath/fuzion/work/build/bin
# NYI fix the path mess, difference in production vs. development
FZ_DIR="$SCRIPTPATH/../fuzion/work/build/bin/"
FUZION_HOME="$(dirname "$FZ_DIR")"
export FUZION_HOME

export PATH="$FZ_DIR:$PATH"

if ! [ -x "$(command -v fz)" ]; then
  echo 'Error: fz not found where expected. Aborting.' >&2
  exit 1
fi

SECONDS=0

BENCHMARKS=$(find . -name run.sh)
{
  for benchmark in $BENCHMARKS; do
    pushd "$(dirname "$benchmark")" > /dev/null || continue
    echo "$(date --iso-8601='seconds') running: $benchmark"
    timeout --preserve-status --kill-after=360s 300s ./run.sh
    popd  > /dev/null || exit
    echo "$(date --iso-8601='seconds') finished: $benchmark"
  done
} >> runall.log.txt

echo "$(date --iso-8601): It took $SECONDS seconds to run all benchmarks." >> "$SCRIPTPATH/runall.log.txt"
last changed: 2023-11-14