2021-09-09 18:53:21 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2021-09-13 11:10:07 +02:00
|
|
|
export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$HOME/.config/lvim"}"
|
|
|
|
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
|
|
|
|
|
|
|
|
export LVIM_TEST_ENV=true
|
|
|
|
|
|
|
|
rm -f "$LUNARVIM_CONFIG_DIR/plugin/packer_compiled.lua"
|
|
|
|
|
|
|
|
lvim() {
|
|
|
|
# TODO: allow running with a minimal_init.lua
|
|
|
|
nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" --cmd "set runtimepath+=$LUNARVIM_RUNTIME_DIR/lvim" "$@"
|
|
|
|
}
|
|
|
|
|
2021-09-09 18:53:21 +02:00
|
|
|
if [ -n "$1" ]; then
|
2021-09-13 11:10:07 +02:00
|
|
|
lvim --headless -c "lua require('plenary.busted').run('$1')"
|
2021-09-09 18:53:21 +02:00
|
|
|
else
|
2021-09-13 11:10:07 +02:00
|
|
|
lvim --headless -c "PlenaryBustedDirectory tests/ { minimal_init = './init.lua' }"
|
2021-09-09 18:53:21 +02:00
|
|
|
fi
|