24 lines
825 B
Makefile
24 lines
825 B
Makefile
.PHONY: test test-internal test-fr test-en
|
|
|
|
SHELL=/bin/bash
|
|
nblines := $(shell wc -l margin-notes.lua | cut -d ' ' -f 1)
|
|
but_four_last_lines := $(shell echo $$(($(nblines) - 4)))
|
|
|
|
test: test test-internal
|
|
|
|
test-internal: margin-notes.lua test/test-functions.lua
|
|
-rm --interactive=never test/tmp.lua
|
|
sed -n 1,$(but_four_last_lines)p margin-notes.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: margin-notes.lua sample.md
|
|
pandoc -t native -L margin-notes.lua sample.md > test/tmp.native
|
|
diff test/tmp.native test/sample.native
|
|
@echo -e '\n===============\ntest passed.\n===============\n'
|
|
rm test/tmp.native
|
|
|