run_test.sh 657 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. set -e
  3. export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
  4. export LVIM_TEST_ENV=true
  5. # we should start with an empty configuration
  6. TEST_BASE_DIR="$(mktemp -d)"
  7. export LUNARVIM_CONFIG_DIR="$TEST_BASE_DIR"
  8. export LUNARVIM_CACHE_DIR="$TEST_BASE_DIR"
  9. lvim() {
  10. nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/tests/minimal_init.lua" --cmd "set runtimepath+=$LUNARVIM_RUNTIME_DIR/lvim" "$@"
  11. }
  12. if [ -n "$1" ]; then
  13. lvim --headless -c "lua require('plenary.busted').run('$1')"
  14. else
  15. lvim --headless -c "PlenaryBustedDirectory tests/specs { minimal_init = './tests/minimal_init.lua' }"
  16. fi
  17. rm -rf "$TEST_BASE_DIR"