2021-09-09 18:53:21 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
2021-09-13 11:10:07 +02:00
|
|
|
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
|
2022-10-22 15:25:46 +02:00
|
|
|
export LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$LUNARVIM_RUNTIME_DIR/lvim"}"
|
2021-09-13 11:10:07 +02:00
|
|
|
|
|
|
|
export LVIM_TEST_ENV=true
|
|
|
|
|
2021-10-31 16:23:44 +01:00
|
|
|
# we should start with an empty configuration
|
2022-04-12 11:18:17 +02:00
|
|
|
LUNARVIM_CONFIG_DIR="$(mktemp -d)"
|
|
|
|
LUNARVIM_CACHE_DIR="$(mktemp -d)"
|
2021-10-31 16:23:44 +01:00
|
|
|
|
2022-04-12 11:18:17 +02:00
|
|
|
export LUNARVIM_CONFIG_DIR LUNARVIM_CACHE_DIR
|
|
|
|
|
2022-10-22 15:25:46 +02:00
|
|
|
printf "cache_dir: %s\nconfig_dir: %s\n" "$LUNARVIM_CACHE_DIR" "$LUNARVIM_CONFIG_DIR"
|
2021-09-13 11:10:07 +02:00
|
|
|
|
|
|
|
lvim() {
|
2022-10-22 15:25:46 +02:00
|
|
|
nvim -u "$LUNARVIM_BASE_DIR/tests/minimal_init.lua" --cmd "set runtimepath+=$LUNARVIM_BASE_DIR" "$@"
|
2021-09-13 11:10:07 +02:00
|
|
|
}
|
|
|
|
|
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
|
2022-01-02 14:53:01 +01:00
|
|
|
lvim --headless -c "PlenaryBustedDirectory tests/specs { minimal_init = './tests/minimal_init.lua' }"
|
2021-09-09 18:53:21 +02:00
|
|
|
fi
|