From 482ea0261cb9f0def49ce3df542b2a7f811262d1 Mon Sep 17 00:00:00 2001 From: Daniel Hader Date: Sun, 14 Jun 2026 12:58:14 -0500 Subject: build and test environment using makefile and basic SDL3 setup --- run_tests.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 run_tests.sh (limited to 'run_tests.sh') diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..578392a --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +testdir=test/bin + +red='\e[0;31m' +yellow='\e[0;33m' +green='\e[0;32m' + +reset='\e[0m' + +lprintf() { + local fmt="$1" + local text="$2" + [[ -x "$text" ]] && return + while IFS= read -r line; do + printf "$fmt" "$line" + done <<< "$text" +} + +echo " ╓──────────╖" +echo "╔═╣ leo test ╠════════════════════════════════════" +echo "║ ╙──────────╜" + +for testbin in $testdir/*; do + if [[ -x "$testbin" ]]; then + echo -ne "╟─ running ${yellow}${testbin}${reset}:\t" + output=$(./$testbin 2>&1) # TODO save output and display at end + if [[ $? -eq 0 ]]; then + echo -e "${green}passed${reset}" + else + echo -e "${red}failed${reset}" + lprintf "║ %s\n" "$output" + fi + fi +done + +echo "║" +echo "╚═════════════════════════════════════════════════" -- cgit v1.2.3