diff --git a/extras/Makefile b/extras/Makefile index 3a0fcaa..46ecfe6 100644 --- a/extras/Makefile +++ b/extras/Makefile @@ -3,11 +3,16 @@ RENDERER:=$(shell echo `js-cpan Test/Base/bin/render-template`) TEST_TEMPLATE:=$(shell echo `js-cpan Test/Base/template/test.html`) INDEX_TEMPLATE:=$(shell echo `js-cpan Test/Base/template/index.html`) +TEST_LOCAL=template/test.html +INDEX_LOCAL=template/index.html -TEST_TEMPLATE_MD5=$(word 1,$(shell md5sum $(TEST_TEMPLATE))) -TEST_LOCAL_MD5=$(word 1,$(shell md5sum template/test.html)) -INDEX_TEMPLATE_MD5=$(word 1,$(shell md5sum $(INDEX_TEMPLATE))) -INDEX_LOCAL_MD5=$(word 1,$(shell md5sum template/index.html)) +MD5SUM=perl -MDigest::MD5 -e \ + 'open X,shift;$$d=Digest::MD5->new;$$d->addfile(*X);print $$d->hexdigest' + +TEST_TEMPLATE_MD5=$(word 1,$(shell $(MD5SUM) $(TEST_TEMPLATE))) +TEST_LOCAL_MD5=$(word 1,$(shell $(MD5SUM) $(TEST_LOCAL))) +INDEX_TEMPLATE_MD5=$(word 1,$(shell $(MD5SUM) $(INDEX_TEMPLATE))) +INDEX_LOCAL_MD5=$(word 1,$(shell $(MD5SUM) $(INDEX_LOCAL))) ALL_T_HTML:=$(shell ls -1 t/*.t.js | perl -pe 's/js$$/html/;s/^t\///') @@ -26,23 +31,24 @@ all: $(ALL_DIRS) $(ALL_TARGETS) $(ALL_LIBS) clean: rm -fr $(ALL_TARGETS) $(ALL_LIBS) if [ "$(TEST_TEMPLATE_MD5)" = \ - "$(TEST_LOCAL_MD5)" ]; then rm -f template/test.html; fi + "$(TEST_LOCAL_MD5)" ]; then rm -f $(TEST_LOCAL); fi if [ "$(INDEX_TEMPLATE_MD5)" = \ - "$(INDEX_LOCAL_MD5)" ]; then rm -f template/index.html; fi + "$(INDEX_LOCAL_MD5)" ]; then rm -f $(INDEX_LOCAL); fi -find $(ALL_DIRS) -depth -type d | xargs rmdir 2> /dev/null purge: clean rm Makefile config.yaml -%.t.html: template/test.html +%.t.html: $(TEST_LOCAL) perl $(RENDERER) $(notdir $<) $(@:%.t.html=t/%.t.js) > $@ -index.html: template/index.html t/*.t.js +index.html: $(INDEX_LOCAL) t/*.t.js perl $(RENDERER) $(notdir $<) $(@:%.t.html=t/%.t.js) > $@ lib/Test/Base.js: lib/Test - cp -f `js-cpan Test.Base` $@ + ln -s ../../../lib/Test/Base.js $@ +# cp -f `js-cpan Test.Base` $@ lib/Test/Builder.js: lib/Test cp -f `js-cpan Test.Builder` $@ @@ -56,10 +62,10 @@ lib/Test/Harness/Browser.js: lib/Test/Harness lib lib/Test lib/Test/Harness: mkdir -p $@ -template/test.html: +$(TEST_LOCAL): cp -f $(TEST_TEMPLATE) $@ -template/index.html: +$(INDEX_LOCAL): cp -f $(INDEX_TEMPLATE) $@ template: diff --git a/sample/Makefile b/sample/Makefile new file mode 120000 index 0000000..0072b3d --- /dev/null +++ b/sample/Makefile @@ -0,0 +1 @@ +../extras/Makefile \ No newline at end of file diff --git a/sample/config.yaml b/sample/config.yaml new file mode 100644 index 0000000..19f1866 --- /dev/null +++ b/sample/config.yaml @@ -0,0 +1,7 @@ +# This file is used to override the following defaults: + +# index_title: A Sample Test.Base Testing Setup +# import_libs: +# - lib/Test/Sample.js +# template_include_path: +# - template