test_runner.sh 614 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. set -e
  3. export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$HOME/.config/lvim"}"
  4. export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
  5. export LVIM_TEST_ENV=true
  6. rm -f "$LUNARVIM_CONFIG_DIR/plugin/packer_compiled.lua"
  7. lvim() {
  8. # TODO: allow running with a minimal_init.lua
  9. nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" --cmd "set runtimepath+=$LUNARVIM_RUNTIME_DIR/lvim" "$@"
  10. }
  11. if [ -n "$1" ]; then
  12. lvim --headless -c "lua require('plenary.busted').run('$1')"
  13. else
  14. lvim --headless -c "PlenaryBustedDirectory tests/ { minimal_init = './init.lua' }"
  15. fi