aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test.sh')
-rwxr-xr-xscripts/test.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
new file mode 100755
index 0000000..7937359
--- /dev/null
+++ b/scripts/test.sh
@@ -0,0 +1,54 @@
+#!/usr/bin/env bash
+set -eou pipefail
+
+source "$(dirname "${BASH_SOURCE[0]}")/lib/log.sh"
+source "$(dirname "${BASH_SOURCE[0]}")/lib/test.sh"
+
+usage() {
+ echo "Usage: $0 [TEST_SUITE]"
+ echo ""
+ echo "Run database test suites"
+ echo ""
+ echo "Arguments:"
+ echo " TEST_SUITE Test suite to run (mssql, sqlite, postgres, mysql)"
+ echo " If not specified, runs all test suites"
+ echo ""
+ echo "Examples:"
+ echo " $0 mssql # Run only MSSQL tests"
+ echo " $0 # Run all test suites"
+}
+
+main() {
+ local suite="${1:-}"
+ if [[ $suite == "-h" || $suite == "--help" ]]; then
+ usage
+ exit 0
+ fi
+
+ if [[ -n "$suite" ]]; then
+ if ! test_is_valid_suite "$suite"; then
+ log_error "Invalid test suite: $suite"
+ log_newline
+ usage
+ exit 1
+ fi
+ test_run_suite "$suite"
+ else
+ log_header "Running all test suites"
+ local failed_suites=()
+ for suite in "${BOLT_TEST_SUITES[@]}"; do
+ if ! test_run_suite "$suite"; then
+ failed_suites+=("$suite")
+ fi
+ done
+
+ if [[ ${#failed_suites[@]} -eq 0 ]]; then
+ log_success "All test suites completed successfully!"
+ else
+ log_error "Failed test suites: ${failed_suites[*]}"
+ exit 1
+ fi
+ fi
+}
+
+main "$@"