Add 'text-crossrefs/' from commit '7e09b67aeda54b4f098e8576c203c809572a85bb'

git-subtree-dir: text-crossrefs
git-subtree-mainline: 02e7a6fef1
git-subtree-split: 7e09b67aed
This commit is contained in:
Bastien Dumont
2024-05-24 13:55:47 +02:00
8 changed files with 2404 additions and 0 deletions

23
text-crossrefs/Makefile Normal file
View File

@ -0,0 +1,23 @@
.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