make: move emulator specific rules to a dedicated file

reviewable/pr12360/r1
Benoit Pierre 1 month ago committed by Frans de Jonge
parent 20ac3c3489
commit 59b533a83d

@ -1,4 +1,4 @@
PHONY = all android-ndk android-sdk base clean coverage distclean doc fetchthirdparty po pot re static-check test testbase testfront
PHONY = all android-ndk android-sdk base clean distclean doc fetchthirdparty po pot re static-check
SOUND = $(INSTALL_DIR)/%
# koreader-base directory
@ -119,32 +119,6 @@ endif
base: base-all
$(INSTALL_DIR)/koreader/.busted: .busted
$(SYMLINK) .busted $@
$(INSTALL_DIR)/koreader/.luacov:
$(SYMLINK) .luacov $@
testbase: base-test
testfront: all test-data $(INSTALL_DIR)/koreader/.busted
# sdr files may have unexpected impact on unit testing
-rm -rf spec/unit/data/*.sdr
cd $(INSTALL_DIR)/koreader && $(BUSTED_LUAJIT) $(BUSTED_OVERRIDES) $(BUSTED_SPEC_FILE)
test: testbase testfront
coverage: $(INSTALL_DIR)/koreader/.luacov
-rm -rf $(INSTALL_DIR)/koreader/luacov.*.out
cd $(INSTALL_DIR)/koreader && \
./luajit $(shell which busted) --output=gtest \
--sort-files \
--coverage --exclude-tags=nocov
# coverage report summary
cd $(INSTALL_DIR)/koreader && tail -n \
+$$(($$(grep -nm1 -e "^Summary$$" luacov.report.out|cut -d: -f1)-1)) \
luacov.report.out
ifeq (,$(wildcard $(KOR_BASE)/Makefile $(KOR_BASE)/Makefile.defs))
$(KOR_BASE)/Makefile $(KOR_BASE)/Makefile.defs: fetchthirdparty
# Need a recipe, even if empty, or make won't know how to remake `base-all`.
@ -174,6 +148,11 @@ distclean: clean base-distclean
re: clean
$(MAKE) all
# Include emulator specific rules.
ifneq (,$(EMULATE_READER))
include make/emulator.mk
endif
# Include target specific rules.
ifneq (,$(wildcard make/$(TARGET).mk))
include make/$(TARGET).mk

@ -0,0 +1,33 @@
# Testing & coverage. {{{
PHONY += coverage test testbase testfront
$(INSTALL_DIR)/koreader/.busted: .busted
$(SYMLINK) .busted $@
$(INSTALL_DIR)/koreader/.luacov:
$(SYMLINK) .luacov $@
testbase: base-test
testfront: all test-data $(INSTALL_DIR)/koreader/.busted
# sdr files may have unexpected impact on unit testing
-rm -rf spec/unit/data/*.sdr
cd $(INSTALL_DIR)/koreader && $(BUSTED_LUAJIT) $(BUSTED_OVERRIDES) $(BUSTED_SPEC_FILE)
test: testbase testfront
coverage: $(INSTALL_DIR)/koreader/.luacov
-rm -rf $(INSTALL_DIR)/koreader/luacov.*.out
cd $(INSTALL_DIR)/koreader && \
./luajit $(shell which busted) --output=gtest \
--sort-files \
--coverage --exclude-tags=nocov
# coverage report summary
cd $(INSTALL_DIR)/koreader && tail -n \
+$$(($$(grep -nm1 -e "^Summary$$" luacov.report.out|cut -d: -f1)-1)) \
luacov.report.out
# }}}
# vim: foldmethod=marker foldlevel=0
Loading…
Cancel
Save