aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-02-19 19:24:37 +0100
committerMattias Andrée <maandree@kth.se>2018-02-19 19:24:37 +0100
commitdc0349df102935554f453a5d68a60f27fe38a09b (patch)
tree2983385577b8d97c0d0969d581907dfa70cdcbd9 /Makefile
parentAdd readme and loc.1 (diff)
downloadloc-dc0349df102935554f453a5d68a60f27fe38a09b.tar.gz
loc-dc0349df102935554f453a5d68a60f27fe38a09b.tar.bz2
loc-dc0349df102935554f453a5d68a60f27fe38a09b.tar.xz
Add tests1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 44 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 00e76ec..24417a8 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,50 @@ loc.o: loc.c arg.h
loc: loc.o
$(CC) -o $@ loc.o $(LDFLAGS)
-check:
- true
+check: loc
+ test "$$(./loc < tests/0)" = 0
+ test "$$(./loc - < tests/0)" = 0
+ test "$$(./loc tests/1 tests/2 | sed 's/: */: /')" = "$$(printf '%s\n' 'tests/1: 0' 'tests/2: 1')"
+ test "$$(./loc tests/0)" = 0
+ test "$$(./loc tests/1)" = 0
+ test "$$(./loc tests/2)" = 1
+ test "$$(./loc tests/3)" = 0
+ test "$$(./loc tests/4)" = 2
+ test "$$(./loc tests/5)" = 2
+ test "$$(./loc tests/6)" = 1
+ test "$$(./loc tests/7)" = 0
+ test "$$(./loc tests/8)" = 1
+ test "$$(./loc tests/9)" = 1
+ test "$$(./loc tests/10)" = 2
+ test "$$(./loc tests/11)" = 0
+ test "$$(./loc tests/12)" = 1
+ test "$$(./loc tests/13)" = 2
+ test "$$(./loc tests/14)" = 1
+ test "$$(./loc tests/15)" = 0
+ test "$$(./loc tests/16)" = 0
+ test "$$(./loc tests/17)" = 1
+ test "$$(./loc tests/18)" = 0
+ test "$$(./loc tests/19)" = 1
+ test "$$(./loc tests/20)" = 1
+ test "$$(./loc tests/21)" = 1
+ test "$$(./loc tests/22)" = 1
+ test "$$(./loc tests/23)" = 1
+ test "$$(./loc tests/24)" = 1
+ test "$$(./loc tests/25)" = 0
+ test "$$(./loc tests/26)" = 3
+ test "$$(./loc tests/27)" = 3
+ test "$$(./loc tests/28)" = 3
+ test "$$(./loc tests/29)" = 3
+ test "$$(./loc tests/30)" = 1
+ test "$$(./loc tests/31)" = 1
+ test "$$(./loc tests/32)" = 1
+ test "$$(./loc tests/33)" = 1
+ test "$$(./loc tests/34)" = 2
+ test "$$(./loc tests/35)" = 2
+ test "$$(./loc tests/36)" = 2
+ test "$$(./loc tests/37)" = 1
+ test "$$(./loc tests/38)" = 0
+ test "$$(./loc tests/39)" = 1
install: loc
mkdir -p -- "$(DESTDIR)$(PREFIX)/bin/"