From 7aeadfe01bcab87d2506b34d865644b3bb5f05a5 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Fri, 25 Sep 2015 08:28:27 -0500 Subject: [PATCH 1/4] Add Makefile --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..34b3610 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +NAME=zsh-syntax-highlighting + +PREFIX?=/usr/local +SHARE_DIR=$(DESTDIR)$(PREFIX)/share/$(NAME) + +install: + $(INSTALL) -d $(SHARE_DIR) + cp -r zsh-syntax-highlighting.zsh highlighters $(SHARE_DIR) From 83c3f96109d353ffc6b808e46229f6416b6f116b Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Fri, 25 Sep 2015 21:29:51 -0500 Subject: [PATCH 2/4] Makefile: Add test target --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 34b3610..3677977 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,11 @@ SHARE_DIR=$(DESTDIR)$(PREFIX)/share/$(NAME) install: $(INSTALL) -d $(SHARE_DIR) cp -r zsh-syntax-highlighting.zsh highlighters $(SHARE_DIR) + +test: + @for test in highlighters/*; do \ + if [ -d $$test/test-data ]; then \ + echo "Running test $${test##*/}"; \ + zsh tests/test-highlighting.zsh "$${test##*/}"; \ + fi \ + done From 2883c9582dc35e0f70e49b79622e09015bc972fb Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 19 Oct 2015 01:36:42 -0500 Subject: [PATCH 3/4] Makefile: exit non-zero for a failed test --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 3677977..680c116 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,12 @@ install: cp -r zsh-syntax-highlighting.zsh highlighters $(SHARE_DIR) test: + @result=0 @for test in highlighters/*; do \ if [ -d $$test/test-data ]; then \ echo "Running test $${test##*/}"; \ zsh tests/test-highlighting.zsh "$${test##*/}"; \ + : $$(( result |= $$? )); \ fi \ done + @exit $$result From 94191f0731c6285dc9b8bd71a07933782c370c33 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 19 Oct 2015 01:44:02 -0500 Subject: [PATCH 4/4] Makefile: Add default for INSTALL --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 680c116..68fbf0d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ NAME=zsh-syntax-highlighting +INSTALL?=install -c PREFIX?=/usr/local SHARE_DIR=$(DESTDIR)$(PREFIX)/share/$(NAME)