#!/bin/bash
Fail()
{
    echo "FAIL(runtests): $1"
    exit 1
}

cppcheck --error-exitcode=9 --inline-suppr --suppress=unmatchedSuppression --suppress=missingIncludeSystem --suppress=missingInclude --suppress=useStlAlgorithm --suppress=unusedFunction --suppress=passedByValue --suppress=constVariableReference --suppress=variableScope -I ../src  --enable=all ../src || Fail "cppcheck frowns upon this code"
cd cmdline || Fail "cannot change to cmdline directory"
./run || exit 1
cd ../unittest || Fail "cannot change directory to ../unittest"
./run || exit 1
echo "runtests: All tests passed."
exit 0
