diff options
author | Julian Smith <jules@op59.net> | 2020-09-01 10:03:38 +0100 |
---|---|---|
committer | Julian Smith <jules@op59.net> | 2020-09-01 10:03:38 +0100 |
commit | da95d554b7ae9f1aaeb688d742f7efa758b4e801 (patch) | |
tree | 09a136bbefbcea6653288b8b91f8d41fe8d08702 | |
parent | a0134b81da1a7960041e3077cf41338992708f4b (diff) |
rename mu-raw to mu, and minor cleanups.
-rw-r--r-- | Makefile | 41 | ||||
-rw-r--r-- | Python2.pdf.mu.content.ref.xml (renamed from Python2.pdf.mu-raw.content.ref.xml) | 0 | ||||
-rw-r--r-- | zlib.3.pdf.mu.content.ref.xml (renamed from zlib.3.pdf.mu-raw.content.ref.xml) | 0 |
3 files changed, 24 insertions, 17 deletions
@@ -1,5 +1,6 @@ # Example commands: -# make build=debug test +# make +# make test # make build=debug-opt # make build=opt # @@ -8,9 +9,15 @@ # Build flags. # build = debug + flags_link = -W -Wall -lm flags_compile = -W -Wall -MMD -MP +# We assume that mutool and gs are available at hard-coded paths. +# +gs = ../ghostpdl/debug-bin/gs +mutool = ../mupdf/build/debug/mutool + ifeq ($(build),) $(error Need to specify build=debug|opt|debug-opt|memento) else ifeq ($(build),debug) @@ -49,57 +56,57 @@ dep = $(obj:.o=.d) # Test rules. # -# We assume that mutool and gs are available at hard-coded paths. -# + test: test-mu test-gs test-mu-as test-mu: Python2.pdf-test-mu zlib.3.pdf-test-mu +test-gs: zlib.3.pdf-test-gs Python2.pdf-test-gs test-mu-as: Python2.pdf-test-mu-as zlib.3.pdf-test-mu-as %.pdf-test: %.pdf-test-mu %.pdf-test-gs +# Test using mutool to generate intermediate. +# %.pdf-test-mu: %.pdf $(exe) @echo - @echo === Testing $< + @echo === Testing $< with mutool. mkdir -p test @echo == Generating intermediate with mutool. - ../mupdf/build/debug/mutool draw -F xmltext -o test/$<.mu-raw.intermediate.xml $< + $(mutool) draw -F xmltext -o test/$<.mu.intermediate.xml $< @echo == Generating output. - ./$(exe) -i test/$<.mu-raw.intermediate.xml --o-content test/$<.mu-raw.content.xml -o test/$<.mu-raw.docx -p 1 -t template.docx + ./$(exe) -i test/$<.mu.intermediate.xml --o-content test/$<.mu.content.xml -o test/$<.mu.docx -p 1 -t template.docx @echo == Comparing output with reference output. - diff -u test/$<.mu-raw.content.xml $<.mu-raw.content.ref.xml + diff -u test/$<.mu.content.xml $<.mu.content.ref.xml @echo == Test succeeded. # Run extract.exe with --autosplit, to stress joining of spans. Compare with # the default .ref file. %.pdf-test-mu-as: %.pdf $(exe) @echo - @echo === Testing $< + @echo === Testing $< with mutool and autosplit. mkdir -p test @echo == Generating intermediate with mutool. - ../mupdf/build/debug/mutool draw -F xmltext -o test/$<.mu-raw.intermediate.xml $< + $(mutool) draw -F xmltext -o test/$<.mu.intermediate.xml $< @echo == Generating output. - ./$(exe) --autosplit 1 -i test/$<.mu-raw.intermediate.xml --o-content test/$<.mu-raw.as.content.xml -o test/$<.mu-raw.as.docx -p 1 -t template.docx + ./$(exe) --autosplit 1 -i test/$<.mu.intermediate.xml --o-content test/$<.mu.as.content.xml -o test/$<.mu.as.docx -p 1 -t template.docx @echo == Comparing output with reference output. - diff -u test/$<.mu-raw.as.content.xml $<.mu-raw.content.ref.xml + diff -u test/$<.mu.as.content.xml $<.mu.content.ref.xml @echo == Test succeeded. +# Test using gs to generate intermediate. +# %.pdf-test-gs: %.pdf $(exe) @echo - @echo === Testing $< + @echo === Testing $< with gs mkdir -p test @echo == Generating intermediate with gs. - ../ghostpdl/debug-bin/gs -sDEVICE=txtwrite -dTextFormat=4 -o test/$<.gs.intermediate.xml $< + $(gs) -sDEVICE=txtwrite -dTextFormat=4 -o test/$<.gs.intermediate.xml $< @echo == Generating output. ./$(exe) -i test/$<.gs.intermediate.xml --o-content test/$<.gs.content.xml -o test/$<.gs.docx -p 1 -t template.docx @echo == Comparing output with reference output. diff -u test/$<.gs.content.xml $<.gs.content.ref.xml @echo == Test succeeded. -test-gs: zlib.3.pdf-test-gs Python2.pdf-test-gs - -test-as: Python2.pdf-test4-mu Python2.pdf-test4as-mu - diff -u test/Python2.pdf.mu-raw4.content.xml test/Python2.pdf.mu-raw4as.content.xml # Build rules. # diff --git a/Python2.pdf.mu-raw.content.ref.xml b/Python2.pdf.mu.content.ref.xml index 6d92c53..6d92c53 100644 --- a/Python2.pdf.mu-raw.content.ref.xml +++ b/Python2.pdf.mu.content.ref.xml diff --git a/zlib.3.pdf.mu-raw.content.ref.xml b/zlib.3.pdf.mu.content.ref.xml index 3f37918..3f37918 100644 --- a/zlib.3.pdf.mu-raw.content.ref.xml +++ b/zlib.3.pdf.mu.content.ref.xml |