pandoc-lua-filters/text-crossrefs/Makefile
Bastien Dumont 6f5b110c9e Add 'text-crossrefs/' from commit '7e09b67aeda54b4f098e8576c203c809572a85bb'
git-subtree-dir: text-crossrefs
git-subtree-mainline: 02e7a6fef1
git-subtree-split: 7e09b67aed
2024-05-24 13:55:47 +02:00

24 lines
924 B
Makefile

.PHONY: test-all test-internal
SHELL=/bin/bash
return_statement_line_number := $(shell grep -nE '^return' text-crossrefs.lua | cut -d ':' -f 1)
line_before_return := $(shell echo $$(($(return_statement_line_number) - 1)))
test-all: test-internal test-context test-latex test-opendocument
test-internal: text-crossrefs.lua
-rm --interactive=never test/tmp.lua
sed -n 1,$(line_before_return)p text-crossrefs.lua > test/tmp.lua
cat test/test-functions.lua >> test/tmp.lua
chmod -w test/tmp.lua
pandoc -L test/tmp.lua <<< ''
@echo -e '==========================\nAll internal tests passed.\n==========================\n'
rm --interactive=never test/tmp.lua
test-%: text-crossrefs.lua sample.md
TESTED_FORMAT=$* pandoc -t native -L text-crossrefs.lua sample.md > test/tmp-$*.native
diff test/tmp-$*.native test/sample-$*.native
@echo -e '\n===============\ntest passed.\n===============\n'
rm test/tmp-$*.native