diff --git a/Makefile b/Makefile
index 4a2a1c20a2559dc9292f19cc4ca0f6b353bc117f..356e30a7aff2f742ab1c2fabc2b48d3cf4e3bbd3 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,9 @@ LDFLAGS += $(shell pkg-config --libs libsystemd)
 
 all: hddemux hddemux.1
 
+check: hddemux
+	./testsuite
+
 hddemux: hddemux.c
 	gcc $(CFLAGS) $(LDFLAGS) -std=c11 -pedantic -Wall -Werror -o $@ $<
 
@@ -31,4 +34,4 @@ clean:
 	draft-dkg-dprive-demux-dns-http.html \
 	draft-dkg-dprive-demux-dns-http.xml
 
-.PHONY: clean all
+.PHONY: clean all check
diff --git a/testsuite b/testsuite
index e5dc3f8cd4c4beaa2dc2f94ef178b63a21974466..684c128504564c9e51e4282c96cb2a8e123bb57e 100755
--- a/testsuite
+++ b/testsuite
@@ -1,11 +1,15 @@
 #!/bin/bash
 
+set -e
+
 # test suite for hddemux
 
 # this is just a stub.
 
+[ -x ./hddemux ]
+
 # hddemux with no arguments and no listening file descriptors should fail:
-if [ ./hddemux ]; then
+if ./hddemux; then
     false
 fi