Add some integration tests and runner

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-25 13:48:03 -05:00
parent 145739aee2
commit 362590292a
6 changed files with 199 additions and 0 deletions

25
run_asm_tests.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
here="$(dirname "$0")"
cd "$here"
tests="./tests"
RED="\e[31m"
GREEN="\e[32m"
RESET="\e[0m"
# Build project
cargo build
find "$tests" -type f -name '*.asm' | \
while read fname; do
test_name="$(basename "${fname%.asm}")"
printf "%s ... " "$test_name"
cargo run --quiet "$fname"
exit_code="$?"
if (( "$exit_code" == 0 )); then
echo -e "${GREEN}OK${RESET}"
else
echo -e "${RED}FAIL${RESET} ($exit_code)"
fi
done