aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-10-17 21:26:05 +0200
committerMattias Andrée <maandree@kth.se>2017-10-17 21:26:05 +0200
commit03957487571c7f8b9939bb1a8cf2bb827e079e14 (patch)
treee0fcfd7e94ca15e7272b6fff5b9d78770922b88d /Makefile
parentSimplify (diff)
downloadpdeath-03957487571c7f8b9939bb1a8cf2bb827e079e14.tar.gz
pdeath-03957487571c7f8b9939bb1a8cf2bb827e079e14.tar.bz2
pdeath-03957487571c7f8b9939bb1a8cf2bb827e079e14.tar.xz
Add make check
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--Makefile29
1 files changed, 27 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8df5b80..04892ec 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
-all: pdeath
+all: pdeath tinysleep test
.o:
$(CC) -o $@ $^ $(LDFLAGS)
@@ -11,6 +11,31 @@ all: pdeath
.c.o:
$(CC) -o $@ $< $(CPPFLAGS) $(CFLAGS)
+check: pdeath tinysleep test
+ ./pdeath -L >/dev/null
+ ./pdeath -L | grep ABRT >/dev/null
+ ./pdeath -L | grep FPE >/dev/null
+ ./pdeath -L | grep ILL >/dev/null
+ ./pdeath -L | grep INT >/dev/null
+ ./pdeath -L | grep SEGV >/dev/null
+ ./pdeath -L | grep TERM >/dev/null
+ ! ./pdeath 2>/dev/null
+ ! ./pdeath KILL 2>/dev/null
+ ./pdeath KILL true
+ ! ./pdeath KILL false
+ ./pdeath 1 true
+ ./pdeath 1+1 true
+ ./pdeath 2-1 true
+ ! ./pdeath - true 2>/dev/null
+ ! ./test
+ ./pdeath KILL ./test
+ mkdir -p .testdir
+ sleep 1 & printf '%i\n' $$! > .testdir/pid; ./tinysleep
+ kill -0 $$(cat .testdir/pid)
+ ./pdeath KILL sleep 1 & printf '%i\n' $$! > .testdir/pid; ./tinysleep
+ ! kill -0 $$(cat .testdir/pid) 2>/dev/null
+ rm -r .testdir
+
install: pdeath
mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/pdeath"
@@ -25,7 +50,7 @@ uninstall:
-rm -rf -- "$(DESTDIR)$(PREFIX)/share/licenses/pdeath"
clean:
- -rm -f -- *.o pdeath
+ -rm -rf -- *.o pdeath .testdir
SUFFIXES: .o .c.o