bonsix/tests/test.sh

39 lines
933 B
Bash
Raw Normal View History

#!/bin/sh
# Copyright (c) 20232024 Emma Tebibyte <emma@tebibyte.media>
# SPDX-License-Identifier: FSFAP
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and this
# notice are preserved. This file is offered as-is, without any warranty.
set -e
2024-04-24 14:58:35 -06:00
export BIN=build/bin
if ! ls Makefile >/dev/null 2>&1
then
printf '%s: Run this script in the root of the project.\n' "$0" 1>&2
exit 1
fi
printf "Starting Bonsai testing.\n\n"
for script in tests/bonsai/*.sh; do
export UTIL="$(printf '%s\n' "$script" \
| sed -e 's/\.sh//g' -e 's;tests\/bonsai\/;;g')"
printf '%s: %s: Testing utility.\n' "$0" "$UTIL"
"$script"
printf '\n'
done
printf "Starting POSIX compatibility testing.\n\n"
for test in tests/posix/*.sh; do
2024-04-27 15:18:09 -06:00
export PATH="$BIN:$PATH"
printf '%s: %s: Testing utility.\n' "$0" "$test"
"$utility"
printf '\n'
done