#!/bin/sh
# (e) exist as soon as any line fails, and (x) echo commands as they are run
set -ex
echo "$1"

if [[ -n $1 &&  "$1" -eq '-memcheck' ]]; then
  for file in build/*; do valgrind --error-exitcode=1 $file; done
else
  for file in build/*; do $file; done
fi
