1
0
mirror of https://github.com/lenticularis39/axpbox.git synced 2026-01-11 23:53:28 +00:00

42 lines
679 B
Bash
Executable File

#!/bin/bash
success=0
function message() {
echo -n -e '\033[1;36m' >&2
echo $1 >&2
echo -n -e '\033[0m' >&2
}
function run_test() {
local old_pwd=$(pwd)
message "[test] Started test $1 at $(date)"
cd "test/$1"
./test.sh
local result=$?
cd "$old_pwd"
if [ "$result" -eq "0" ]
then
message "[test] Test $1 finished at $(date)" >&2
else
success=1
message "[test] Test $1 failed at $(date)" >&2
fi
}
message "[test] This is the AXPbox test script"
run_test rom
run_test disk/unwritable
if [ "$success" -ne "0" ]
then
message "[test] Some tests failed, please check the log"
else
message "[test] All tests passed"
fi
exit "$success"