Browse Source

Add a simple autopkgtest

Christoph Biedl 3 years ago
parent
commit
34e8c5a62e
2 changed files with 19 additions and 0 deletions
  1. 2 0
      debian/tests/control
  2. 17 0
      debian/tests/run-testsuite

+ 2 - 0
debian/tests/control

@@ -0,0 +1,2 @@
+Tests: run-testsuite
+Depends: @

+ 17 - 0
debian/tests/run-testsuite

@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+
+CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) -DHTTP_PARSER_STRICT=0
+CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
+
+all: test_auto
+	./test_auto
+
+test_auto: test_auto.o
+	$(CC) $(CFLAGS) $(LDFLAGS) $< -lhttp_parser -o $@
+
+test_auto.o: test_auto.c
+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+test_auto.c: test.c
+	sed -e 's/#include "http_parser.h"/#include <http_parser.h>/' <$< >$@