-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
34 lines (24 loc) · 1.03 KB
/
Makefile
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
INIT_RC ?= test/minimal_init.lua
PLENARY_DIR ?= $(XDG_DATA_HOME)/nvim/site/pack/packer/start/plenary.nvim
NVIM_TS_DIR ?= $(XDG_DATA_HOME)/nvim/site/pack/packer/start/nvim-treesitter
test-data: test/data/bigdata.json test/data/bigdata.yml
test/data/bigdata.json:
+mkdir -p test/data
+curl -L --progress-bar -o $@ \
"https://raw.githubusercontent.com/miloyip/nativejson-benchmark/master/data/canada.json"
test/data/bigdata.yml:
+mkdir -p test/data
+base64 /dev/urandom | head --bytes $$(( 5*1024*1024 )) > $@
deps: $(PLENARY_DIR) $(NVIM_TS_DIR)
$(PLENARY_DIR):
git clone --depth=1 "https://github.com/nvim-lua/plenary.nvim" $(PLENARY_DIR)
$(NVIM_TS_DIR):
git clone --depth=1 "https://github.com/nvim-treesitter/nvim-treesitter" $(NVIM_TS_DIR)
test: deps test-data
nvim --headless -u $(INIT_RC) -c "PlenaryBustedDirectory test/specs { minimal_init = '$(INIT_RC)' }"
test-file: deps
nvim --headless -u $(INIT_RC) -c "lua require('plenary.busted').run('$(FILE)')"
lint:
luacheck lua
stylua --check lua
.PHONY: test test-file lint