From 16bf40bd649ba065a7a0a6008c8434335ffae55a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 28 Aug 2021 14:26:32 -0700 Subject: Added tests/tutorial --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f5eb960..71d9b80 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,15 @@ clean: rm -f $(NAME) $(OBJFILES) test: $(NAME) - ./$(NAME) Comment -r '[@0]' - ./$(NAME) -g ./grammars/bp.bp -p Grammar ./grammars/bp.bp + ./$(NAME) Comment -r '[@0]' >/dev/null + ./$(NAME) -g ./grammars/bp.bp -p Grammar ./grammars/bp.bp >/dev/null + for test in tests/*.sh; do \ + sh "$$test" <"$${test/.sh/.in}" | diff -q - "$${test/.sh/.out}" ||\ + sh "$$test" <"$${test/.sh/.in}" | diff -y --color=always - "$${test/.sh/.out}"; \ + done + +tutorial: + ./tutorial.sh leaktest: bp valgrind --leak-check=full ./bp -l -g ./grammars/bp.bp -p Grammar ./grammars/bp.bp @@ -74,4 +81,4 @@ uninstall: [ "$$confirm" != n ] && rm -rf ~/.config/$(NAME); \ fi -.PHONY: all clean install uninstall leaktest splint test +.PHONY: all clean install uninstall leaktest splint test tutorial -- cgit v1.2.3