aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test.sh')
-rwxr-xr-xscripts/test.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
new file mode 100755
index 0000000..ea35ef7
--- /dev/null
+++ b/scripts/test.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+main() {
+ echo "Running tests..."
+ local ctest_result=0
+ local bats_result=0
+
+ if ! (cd build && ctest --output-on-failure); then
+ ctest_result=1
+ fi
+ if ! ./tests/vendor/bats-core/bin/bats ./tests/justify.bats; then
+ bats_result=1
+ fi
+ exit $((ctest_result || bats_result))
+}
+
+main "$@"