chore(tests): move tests out of lua directory (#621)
This commit is contained in:
parent
181b14348f
commit
5a91d816a0
4
Makefile
4
Makefile
|
@ -12,7 +12,7 @@ test:
|
||||||
@mkdir -p tmp_home
|
@mkdir -p tmp_home
|
||||||
@export XDG_DATA_HOME='./tmp_home' && \
|
@export XDG_DATA_HOME='./tmp_home' && \
|
||||||
export XDG_CONFIG_HOME='./tmp_home' && \
|
export XDG_CONFIG_HOME='./tmp_home' && \
|
||||||
nvim --headless -u lua/tests/minimal_init.lua -c "lua require'plenary.test_harness'.test_directory( 'lua/tests/', { minimal_init = './lua/tests/minimal_init.lua' })" -c "qa!"
|
bash ./scripts/test_runner.sh
|
||||||
@rm -rf tmp_home
|
@rm -rf tmp_home
|
||||||
|
|
||||||
# Install luacov & luacov-console from luarocks
|
# Install luacov & luacov-console from luarocks
|
||||||
|
@ -22,7 +22,7 @@ testcov:
|
||||||
@export XDG_DATA_HOME=$(realpath './tmp_home/data') && \
|
@export XDG_DATA_HOME=$(realpath './tmp_home/data') && \
|
||||||
export XDG_CONFIG_HOME=$(realpath './tmp_home/config') && \
|
export XDG_CONFIG_HOME=$(realpath './tmp_home/config') && \
|
||||||
export TEST_COV=true && \
|
export TEST_COV=true && \
|
||||||
nvim --headless -u lua/tests/minimal_init.lua -c "lua require'plenary.test_harness'.test_directory( 'lua/tests/', { minimal_init = './lua/tests/minimal_init.lua' })" -c "qa!"
|
bash ./scripts/test_runner.sh
|
||||||
@luacov-console lua/
|
@luacov-console lua/
|
||||||
@luacov-console -s
|
@luacov-console -s
|
||||||
ifeq ($(NOCLEAN), )
|
ifeq ($(NOCLEAN), )
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
REPO_DIR=$(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
nvim_t() {
|
||||||
|
nvim -u "$REPO_DIR/tests/minimal_init.lua" -c "set runtimepath+=$REPO_DIR" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
nvim_t --headless -c "lua require('plenary.busted').run('$1')"
|
||||||
|
else
|
||||||
|
nvim_t --headless -c "lua require'plenary.test_harness'.test_directory( 'tests/', { minimal_init = './tests/minimal_init.lua' })" -c "qa!"
|
||||||
|
fi
|
Loading…
Reference in New Issue