-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (39 loc) · 1.11 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Variables:
# DIR: path to dir or file to test (default: all of target's files/tests)
# SEQ/SYNC: if set, run tests sequentially (default: true for benchmarks, otherwise false)
.PHONY: test t fmt format perf bench checkfmt types defaults
# because ifdef considers empty vars unset...
ifneq "$(origin SEQ)" "undefined"
SEQ ::= true
else ifneq "$(origin SYNC)" "undefined"
SEQ ::= true
else
SEQ ::= false
endif
define run-test
nvim -v
nvim \
--noplugin \
-u tests/min_init.lua \
-i NONE \
-n \
--headless \
-c "PlenaryBustedDirectory $(DIR) {sequential = $(SEQ), minimal_init = 'tests/min_init.lua'}"
@printf '\n\033[1mALL TESTS PASSED\033[0m\n'
endef
t test: DIR ::= $(or $(DIR),tests)
t test:
@$(run-test)
fmt format:
stylua .
checkfmt:
stylua -c .
perf bench: DIR ::= $(or $(DIR),perf)
perf bench: override SEQ ::= true
perf bench:
@$(run-test)
types:
@nvim -l scripts/types.lua
defaults:
@nvim -l scripts/defaults.lua
# @stylua - <<< 'require("sos").setup '"$(nvim -c 'set rtp^=.' -l - <<< 'print(require"sos.config".def:print_default())' 2>&1)"