ORIG_DIR=$(pwd) cd "${ORIG_DIR}/tests/should_pass" PASS_FILES=$(ls) for file in $PASS_FILES; do echo "[+] testing ${file} (expect pass)" ./"${file}" || exit 1 echo "[+] ${file} passed as expected" done cd "${ORIG_DIR}/tests/should_fail" FAIL_FILES=$(ls) for file in $FAIL_FILES; do echo "[+] testing ${file} (expect failure)" ./"${file}" && exit 1 echo "[+] ${file} failed as expected" done