Placed test targets in their own Makefile to faciliate using tests as prerequisites for ease-full.js, ensuring it'll be rebuilt on test modification
parent
3fe132c862
commit
fba584171c
19
Makefile
19
Makefile
|
@ -21,17 +21,12 @@ PATH_DOC_IMG=${PATH_DOC}/img
|
|||
PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi
|
||||
|
||||
src_js := index.js $(wildcard $(PATH_LIB)/*.js)
|
||||
src_tests := index.js $(wildcard $(PATH_TEST)/test-*)
|
||||
doc_src := $(wildcard $(PATH_DOC)/*.texi)
|
||||
doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(PATH_DOC_IMG)/*.dia))
|
||||
|
||||
COMBINE=${PATH_TOOLS}/combine
|
||||
|
||||
TESTS := $(shell find "$(PATH_TEST)" \
|
||||
-name 'test-*' \
|
||||
-a ! -name 'test-combine*.js'\
|
||||
)
|
||||
TEST_COMBINE := $(PATH_TEST)/test-combine*.js
|
||||
|
||||
|
||||
.PHONY: combine doc test test-combine
|
||||
|
||||
|
@ -51,19 +46,15 @@ mkbuild-doc: $(PATH_DOC_OUTPUT)
|
|||
# browser)
|
||||
$(PATH_COMBINE_OUTPUT): $(src_js) | mkbuild
|
||||
${COMBINE} > "$(PATH_COMBINE_OUTPUT)"
|
||||
$(PATH_COMBINE_OUTPUT_FULL): $(src_js) | mkbuild
|
||||
$(PATH_COMBINE_OUTPUT_FULL): $(src_js) $(src_tests) | mkbuild
|
||||
INC_TEST=1 "$(COMBINE)" > "${PATH_COMBINE_OUTPUT_FULL}"
|
||||
$(PATH_BUILD)/browser-test.html: $(PATH_COMBINE_OUTPUT_FULL)
|
||||
cp "$(PATH_BROWSER_TEST)" "$(PATH_BUILD)"
|
||||
combine: $(PATH_COMBINE_OUTPUT) $(PATH_BUILD)/browser-test.html
|
||||
|
||||
# run tests
|
||||
test: default $(TESTS) test-combine
|
||||
test-combine: default $(TEST_COMBINE)
|
||||
test-%.js: default
|
||||
node $@
|
||||
test-%: default
|
||||
./$@
|
||||
|
||||
test:
|
||||
$(MAKE) -C $(PATH_TEST)
|
||||
|
||||
# performance tests
|
||||
perf: default $(PERF_TESTS)
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
tests := $(shell find . \
|
||||
-name 'test-*' \
|
||||
-a ! -name 'test-combine*.js'\
|
||||
)
|
||||
tests_combine := test-combine*.js
|
||||
|
||||
.PHONY: FORCE test test-combine
|
||||
|
||||
|
||||
default: $(tests) combine
|
||||
combine: $(tests_combine)
|
||||
|
||||
test-%.js: FORCE
|
||||
node $@
|
||||
test-%: FORCE
|
||||
./$@
|
Loading…
Reference in New Issue