WIP: testing #96

Draft
emma wants to merge 23 commits from testing into main
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 94ada03ce4 - Show all commits

View File

@ -0,0 +1,4 @@
#!/bin/sh
export RUN_ERR='Run this script in the root of the project'
export TEST_STR='Testing utility'

View File

@ -9,11 +9,13 @@
set -e
. "./locales/$LANG"
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
printf '%s: %s.\n' "$0" "$RUN_ERR" 1>&2
exit 1
fi
emma marked this conversation as resolved
Review

This seems ineligant. Programmatically print the test suite name at tests/$suite/Name, falling back to the folder name itself.

for suite in tests/*; do
    if ! scrut -d "$suite"
        then continue
    fi
    s="$suite" sh -c '
            scrut -e "$s"/Name \
                && mm <"$s/Name" \
                || printf "%s\n" "$s"'
        | xargs printf 'Testing <%s>...\n'
    # testing stuff
done
This seems ineligant. Programmatically print the test suite name at `tests/$suite/Name`, falling back to the folder name itself. ```sh for suite in tests/*; do if ! scrut -d "$suite" then continue fi s="$suite" sh -c ' scrut -e "$s"/Name \ && mm <"$s/Name" \ || printf "%s\n" "$s"' | xargs printf 'Testing <%s>...\n' # testing stuff done
@ -21,7 +23,7 @@ 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"
printf '%s: %s: %s\n' "$0" "$UTIL" "$TEST_STR"
"$script"
printf '\n'
done