Add a run file with a consistent test task

This commit is contained in:
Oliver Davies 2024-01-16 15:55:22 +00:00
parent 9be750fdf7
commit 812ab02bfa
2 changed files with 24 additions and 1 deletions

2
.tmux
View file

@ -20,7 +20,7 @@ tmux send-keys -t "${session_name}:vim" "nvim" Enter
tmux split-pane -t "${session_name}:vim" -h -c "${session_path}" -p 40
tmux send-keys -t "${session_name}:vim.right" "php -S 0.0.0.0:9000 -t web" Enter
tmux split-pane -t "${session_name}:vim" -c "${session_path}" -v
tmux send-keys -t "${session_name}:vim.bottom-right" "paratest && watch-changes web/modules/custom paratest" Enter
tmux send-keys -t "${session_name}:vim.bottom-right" "./run test && watch-changes web/modules/custom ./run test" Enter
# 2. General shell use.
tmux new-window -t "${session_name}" -c "${session_path}"

23
run Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
PATH=${PATH}:./vendor/bin
# Display a list of all available commands.
function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"
compgen -A function | grep -v "^_" | cat -n
printf "\nExtended help:\n Each task has comments for general usage\n"
}
# Run PHPUnit tests.
function test {
paratest --group lessons "${@}"
}
TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"