From fba584171c1e6a005f56306c1420845deac59b1a Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 20 Mar 2011 02:28:40 -0400 Subject: [PATCH] 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 --- Makefile | 19 +++++-------------- test/Makefile | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 test/Makefile diff --git a/Makefile b/Makefile index b9af7e4..6f1a82d 100644 --- a/Makefile +++ b/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) diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..1a3e26b --- /dev/null +++ b/test/Makefile @@ -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 + ./$@