#!/bin/bash 
# check if the PATO unit-testing can start properly
echo PATO unit-testing: first check
if [ -z "${PATO_DIR}" ]; then
    echo Error: \$PATO_DIR not defined >&2
    exit 1
fi
cd $PATO_DIR
echo - Tutorials check
n_tuto=`find tutorials -name Allrun | wc -l | tr -dc ‘0-9’`
n_ref=`find src/applications/utilities/tests/testsuites/tutorials/ref -name Allrun | wc -l | tr -dc ‘0-9’`

if [ $n_tuto -ne $n_ref ]; then
    echo "Error: $n_tuto folders with Allrun in tutorials and $n_ref folders with Allrun in src/applications/utilities/tests/testsuites/tutorials/ref"
    exit 1
fi
echo Passed: ci_gitlab/success

