-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathlua-test.sh
More file actions
executable file
·44 lines (37 loc) · 1.06 KB
/
lua-test.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
#
# Setup and run tests for lua part of gitlab.nvim.
# Requires `luarocks`, `git`, and `nvim` installed.
#
set -euo pipefail
PLUGINS_FOLDER="tests/plugins"
PLUGINS=(
"https://github.com/MunifTanjim/nui.nvim"
"https://github.com/nvim-lua/plenary.nvim"
"https://github.com/sindrets/diffview.nvim"
)
if ! command -v luarocks >/dev/null 2>&1; then
echo "Error: luarocks not found. Please install LuaRocks." >&2
exit 1
fi
if ! command -v git >/dev/null 2>&1; then
echo "Error: git not found. Please install Git." >&2
exit 1
fi
if ! command -v nvim >/dev/null 2>&1; then
echo "Error: nvim not found. Please install Neovim." >&2
exit 1
fi
# Clone test plugin dependencies
mkdir -p "$PLUGINS_FOLDER"
for plugin in "${PLUGINS[@]}"; do
plugin_name="${plugin##*/}"
plugin_folder="$PLUGINS_FOLDER/$plugin_name"
if [[ ! -d "$plugin_folder/.git" ]]; then
echo "Cloning $plugin..."
git clone --depth 1 "$plugin" "$plugin_folder"
fi
done
# Run tests
echo "Running tests with Neovim..."
nvim -u NONE -U NONE -N -i NONE -l tests/init.lua "$@"