]> git.donarmstrong.com Git - lilypond.git/commitdiff
Archive baselines in LILYPOND_BASELINES directory if specified
authorDavid Kastrup <dak@gnu.org>
Tue, 20 Mar 2012 11:32:10 +0000 (12:32 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 21 Mar 2012 08:33:54 +0000 (09:33 +0100)
GNUmakefile.in

index 0ad3c6e30b409ecd6647e2ff91392399cf196d39..20a8591cdd04c3bd69ab3035cb4e691a96122f4b 100644 (file)
@@ -284,9 +284,32 @@ test:
        $(MAKE) -C input/regression/abc2ly out=test local-test
        $(MAKE) -C input/regression/lilypond-book out=test local-test
 
-test-baseline:
+ifndef BASELINE_COMMIT
+BASELINE_COMMIT:=HEAD
+endif
+
+ifdef LILYPOND_BASELINES
+BASELINE_ARCHIVE:=$(LILYPOND_BASELINES)/baseline-$(shell git rev-list -1 $(BASELINE_COMMIT)).tar.gz
+
+test-baseline: $(BASELINE_ARCHIVE)
+       tar xzf $(BASELINE_ARCHIVE)
+       $(MAKE) test-snippets-clean
+
+$(BASELINE_ARCHIVE):
+       $(MAKE) test-baseline-create
+       tar czf $(BASELINE_ARCHIVE) input/regression/out-test-baseline \
+               input/regression/midi/out-test-baseline \
+               input/regression/musicxml/out-test-baseline \
+               input/regression/abc2ly/out-test-baseline \
+               input/regression/lilypond-book/out-test-baseline
+else
+test-baseline: test-baseline-create
+       $(MAKE) test-snippets-clean
+endif
+
+test-baseline-create:
        @if test -d .git ; then \
-               $(if $(shell git diff), echo "commit before base lining" && false,true) ; \
+               $(if $(shell git diff $(BASELINE_COMMIT)), echo "commit before base lining" && false,true) ; \
        fi
        $(MAKE)
        $(MAKE) test
@@ -295,8 +318,6 @@ test-baseline:
        $(MAKE) out=test -C input/regression/musicxml local-test-baseline
        $(MAKE) out=test -C input/regression/abc2ly local-test-baseline
        $(MAKE) out=test -C input/regression/lilypond-book local-test-baseline
-       $(MAKE) test-snippets-clean
-
 
 local-check: test
        rm -rf $(RESULT_DIR)