#!/bin/bash
#
# Set of extra tests which may run after the full_system_test.sh
# Particularly, they use the files generated by the full_system_test.sh
#
. ${O2_ROOT}/share/scripts/jobutils.sh

if [ "0$O2_ROOT" == "0" ]; then
  eval "`alienv shell-helper`"
  alienv --no-refresh load O2/latest
fi

NHBPERTF=${NHBPERTF:-128} # number of HBFs per orbit to expect in pregenerated files

# Set general arguments
ARGS_ALL="--session default --shm-segment-size $SHMSIZE"

# below we add individual tests
execname=""
logfile=""

# FT0
# run  raw->digits conversion from the raw data create elsewhere
execname=o2-raw-file-reader-workflow
taskwrapper ${execname}.log $execname "$ARGS_ALL --configKeyValues \"HBFUtils.nHBFPerTF=${NHBPERTF}\" --detect-tf0 --input-conf raw/FT0/FT0raw.cfg | o2-ft0-flp-dpl-workflow  $ARGS_ALL -b"
# and check its correctness
execname=o2-ft0-test-raw-conversion
taskwrapper ${execname}.log $execname
# don't proceed to other tests if error was found
[ ! -f "${execname}.log_done" ] || [ "$?" != 0 ] && exit

# other tests to add
