1
0
Fork 0

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

closure/master
Mike Gerwitz 2011-03-20 02:28:40 -04:00
parent 3fe132c862
commit fba584171c
2 changed files with 22 additions and 14 deletions

View File

@ -21,17 +21,12 @@ PATH_DOC_IMG=${PATH_DOC}/img
PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi PATH_MANUAL_TEXI=${PATH_DOC}/manual.texi
src_js := index.js $(wildcard $(PATH_LIB)/*.js) src_js := index.js $(wildcard $(PATH_LIB)/*.js)
src_tests := index.js $(wildcard $(PATH_TEST)/test-*)
doc_src := $(wildcard $(PATH_DOC)/*.texi) doc_src := $(wildcard $(PATH_DOC)/*.texi)
doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(PATH_DOC_IMG)/*.dia)) doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(PATH_DOC_IMG)/*.dia))
COMBINE=${PATH_TOOLS}/combine 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 .PHONY: combine doc test test-combine
@ -51,19 +46,15 @@ mkbuild-doc: $(PATH_DOC_OUTPUT)
# browser) # browser)
$(PATH_COMBINE_OUTPUT): $(src_js) | mkbuild $(PATH_COMBINE_OUTPUT): $(src_js) | mkbuild
${COMBINE} > "$(PATH_COMBINE_OUTPUT)" ${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}" INC_TEST=1 "$(COMBINE)" > "${PATH_COMBINE_OUTPUT_FULL}"
$(PATH_BUILD)/browser-test.html: $(PATH_COMBINE_OUTPUT_FULL) $(PATH_BUILD)/browser-test.html: $(PATH_COMBINE_OUTPUT_FULL)
cp "$(PATH_BROWSER_TEST)" "$(PATH_BUILD)" cp "$(PATH_BROWSER_TEST)" "$(PATH_BUILD)"
combine: $(PATH_COMBINE_OUTPUT) $(PATH_BUILD)/browser-test.html combine: $(PATH_COMBINE_OUTPUT) $(PATH_BUILD)/browser-test.html
# run tests
test: default $(TESTS) test-combine test:
test-combine: default $(TEST_COMBINE) $(MAKE) -C $(PATH_TEST)
test-%.js: default
node $@
test-%: default
./$@
# performance tests # performance tests
perf: default $(PERF_TESTS) perf: default $(PERF_TESTS)

17
test/Makefile 100644
View File

@ -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
./$@