diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2023-08-27 18:15:04 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2023-08-27 18:15:09 -0700 |
commit | f87f3ea322b1111e1929d149224ff736c8390db3 (patch) | |
tree | 44b11765d02fbb8b88bedafa4bde69ff33d22ad9 /run_tests.sh | |
parent | 446aa570048586f9c13f1ea88e280567f336691e (diff) |
test: add a test suite
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..98b4fa7 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +mkdir -p ".testenv/config/nvim" +mkdir -p ".testenv/data/nvim" +mkdir -p ".testenv/state/nvim" +mkdir -p ".testenv/run/nvim" +mkdir -p ".testenv/cache/nvim" +PLUGINS=".testenv/data/nvim/site/pack/plugins/start" + +if [ ! -e "$PLUGINS/plenary.nvim" ]; then + git clone --depth=1 https://github.com/nvim-lua/plenary.nvim.git "$PLUGINS/plenary.nvim" +else + (cd "$PLUGINS/plenary.nvim" && git pull) +fi + +XDG_CONFIG_HOME=".testenv/config" \ + XDG_DATA_HOME=".testenv/data" \ + XDG_STATE_HOME=".testenv/state" \ + XDG_RUNTIME_DIR=".testenv/run" \ + XDG_CACHE_HOME=".testenv/cache" \ + nvim --headless -u tests/minimal_init.lua \ + -c "PlenaryBustedDirectory ${1-tests} { minimal_init = './tests/minimal_init.lua' }" +echo "Success" |