aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/test.sh
blob: ea35ef7a8887e2118085489bda2742cde5790f18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 "$@"