27 lines
1022 B
Makefile
27 lines
1022 B
Makefile
|
.PHONY: test test-internal test-fr test-en
|
||
|
|
||
|
SHELL=/bin/bash
|
||
|
nblines := $(shell wc -l centuries.lua | cut -d ' ' -f 1)
|
||
|
but_four_last_lines := $(shell echo $$(($(nblines) - 4)))
|
||
|
|
||
|
test: test-fr test-en test-internal
|
||
|
|
||
|
test-internal: centuries.lua test/test-functions.lua
|
||
|
sed -n 1,$(but_four_last_lines)p centuries.lua > test/tmp.lua
|
||
|
cat test/test-functions.lua >> test/tmp.lua
|
||
|
pandoc -L test/tmp.lua <<< ''
|
||
|
@echo -e '==========================\nAll internal tests passed.\n==========================\n'
|
||
|
rm test/tmp.lua
|
||
|
|
||
|
test-en: centuries.lua test/test-english.md
|
||
|
pandoc -t native -L centuries.lua test/test-english.md > test/tmp.native
|
||
|
diff test/tmp.native test/test-english.native
|
||
|
@echo -e '\n===============\ntest-en passed.\n===============\n'
|
||
|
rm test/tmp.native
|
||
|
|
||
|
test-fr: centuries.lua test/test-french.md
|
||
|
pandoc -t native -L centuries.lua test/test-french.md > test/tmp.native
|
||
|
diff test/tmp.native test/test-french.native
|
||
|
@echo -e '\n===============\ntest-fr passed.\n===============\n'
|
||
|
rm test/tmp.native
|