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
|
||||
NAME?=maps
|
||||
|
||||
MODULES=main.fnl
|
||||
MODULES=main.fnl tiles.fnl
|
||||
|
||||
%.lua : %.fnl
|
||||
$(FENNEL) --compile $< > $@
|
||||
@ -11,6 +11,12 @@ $(NAME): $(patsubst %.fnl,%.lua,$(MODULES)) Makefile
|
||||
(echo -e "#!/usr/bin/env lua\n" ; cat main.lua ) > $@
|
||||
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:
|
||||
mkdir -p $(PREFIX)/bin $(PREFIX)/
|
||||
cp $(NAME) $(PREFIX)/bin
|
||||
|
@ -514,4 +514,4 @@ label.readout {
|
||||
(when (os.getenv "MAP_PROFILE") (collect-profile))
|
||||
(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