diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2025-09-27 13:36:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-27 13:36:14 +0200 |
commit | b950c610d4e41ee6bbfc9476020546548c20100d (patch) | |
tree | 172f74f8e19655119fd4c5b0d3979380423fb79c /apps/test-framework/test-main.sh | |
parent | 815d99250aba4fbedf39eecd1c5c32ce1493a0e2 (diff) |
feat(bash): test command in dashboard + fix tests (#23030)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Diffstat (limited to 'apps/test-framework/test-main.sh')
-rw-r--r-- | apps/test-framework/test-main.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/test-framework/test-main.sh b/apps/test-framework/test-main.sh new file mode 100644 index 0000000000..c3a122989d --- /dev/null +++ b/apps/test-framework/test-main.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + + # shellcheck source-path=SCRIPTDIR +CURRENT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# shellcheck source=../bash_shared/includes.sh +source "$CURRENT_PATH/../bash_shared/includes.sh" +# shellcheck source=../bash_shared/menu_system.sh +source "$AC_PATH_APPS/bash_shared/menu_system.sh" + +# Menu: single ordered source of truth (no functions in strings) +# Format: "key|short|description" +menu_items=( + "bash|b|Run Bash tests" + "core|c|Run AzerothCore tests" + "quit|q|Exit from this menu" +) + + +# Menu command handler - called by menu system for each command +function handle_menu_command() { + local key="$1" + shift + + case "$key" in + "bash") + bash "$CURRENT_PATH/run-bash-tests.sh" "${@:-"--all"}" + ;; + "core") + # shellcheck source=./run-core-tests.sh + bash "$CURRENT_PATH/run-core-tests.sh" "$@" + ;; + "quit") + echo "Goodbye!" + exit + ;; + *) + echo "Invalid option. Use --help to see available commands." + return 1 + ;; + esac +} + +# Run the menu system +menu_run_with_items "TEST FRAMEWORK" handle_menu_command -- "${menu_items[@]}" -- "$@" |