add Makefile targets to run in-place and to run tests
This commit is contained in:
parent
360c381b33
commit
6ca0e77604
@ -2,7 +2,7 @@ FENNEL?=fennel
|
|||||||
PREFIX?=/usr/local
|
PREFIX?=/usr/local
|
||||||
NAME?=maps
|
NAME?=maps
|
||||||
|
|
||||||
MODULES=main.fnl
|
MODULES=main.fnl tiles.fnl
|
||||||
|
|
||||||
%.lua : %.fnl
|
%.lua : %.fnl
|
||||||
$(FENNEL) --compile $< > $@
|
$(FENNEL) --compile $< > $@
|
||||||
@ -11,6 +11,12 @@ $(NAME): $(patsubst %.fnl,%.lua,$(MODULES)) Makefile
|
|||||||
(echo -e "#!/usr/bin/env lua\n" ; cat main.lua ) > $@
|
(echo -e "#!/usr/bin/env lua\n" ; cat main.lua ) > $@
|
||||||
chmod +x $@
|
chmod +x $@
|
||||||
|
|
||||||
|
run:
|
||||||
|
( fennel fake-nmea.fnl commute.nmea /tmp/gnss & ) ; sleep 1; fennel -e '((. (require :main) :run) "/tmp/gnss")'
|
||||||
|
|
||||||
|
test:
|
||||||
|
fennel run-tests.fnl $(MODULES)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
mkdir -p $(PREFIX)/bin $(PREFIX)/
|
mkdir -p $(PREFIX)/bin $(PREFIX)/
|
||||||
cp $(NAME) $(PREFIX)/bin
|
cp $(NAME) $(PREFIX)/bin
|
||||||
|
@ -514,4 +514,4 @@ label.readout {
|
|||||||
(when (os.getenv "MAP_PROFILE") (collect-profile))
|
(when (os.getenv "MAP_PROFILE") (collect-profile))
|
||||||
(Gtk:main))
|
(Gtk:main))
|
||||||
|
|
||||||
(run (table.unpack arg))
|
{ : run }
|
||||||
|
10
pkgs/maps/run-tests.fnl
Normal file
10
pkgs/maps/run-tests.fnl
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
(local fennel (require :fennel))
|
||||||
|
(local specials (require :fennel.specials))
|
||||||
|
|
||||||
|
(local compiler-env
|
||||||
|
(doto (. (specials.make-compiler-env) :_G)
|
||||||
|
(tset "RUNNING_TESTS" true)))
|
||||||
|
|
||||||
|
(each [_ f (ipairs arg)]
|
||||||
|
(print :testing f)
|
||||||
|
(fennel.dofile f { :correlate true :compilerEnv compiler-env }))
|
Loading…
Reference in New Issue
Block a user