From 73c4e3b2efccb253d038fa965b5007e000d536d5 Mon Sep 17 00:00:00 2001 From: Mo Zhou Date: Tue, 7 Jan 2020 10:31:08 +0800 Subject: [PATCH] Initialize autopkgtest: compile and run upstream tests. --- debian/tests/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ debian/tests/control | 3 +++ 2 files changed, 46 insertions(+) create mode 100644 debian/tests/Makefile create mode 100644 debian/tests/control diff --git a/debian/tests/Makefile b/debian/tests/Makefile new file mode 100644 index 0000000..dc3ce80 --- /dev/null +++ b/debian/tests/Makefile @@ -0,0 +1,43 @@ +# libutf8proc Makefile + +UCFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) \ + $(shell dpkg-buildflags --get CFLAGS) + +all: check + +test/tests.o: test/tests.c test/tests.h utf8proc.h + $(CC) $(UCFLAGS) -c -o test/tests.o test/tests.c + +test/normtest: test/normtest.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/normtest.c test/tests.o -lutf8proc -o $@ + +test/graphemetest: test/graphemetest.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/graphemetest.c test/tests.o -lutf8proc -o $@ + +test/printproperty: test/printproperty.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/printproperty.c test/tests.o -lutf8proc -o $@ + +test/charwidth: test/charwidth.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/charwidth.c test/tests.o -lutf8proc -o $@ + +test/valid: test/valid.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/valid.c test/tests.o -lutf8proc -o $@ + +test/iterate: test/iterate.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/iterate.c test/tests.o -lutf8proc -o $@ + +test/case: test/case.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/case.c test/tests.o -lutf8proc -o $@ + +test/custom: test/custom.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) test/custom.c test/tests.o -lutf8proc -o $@ + +test/misc: test/misc.c test/tests.o utf8proc.h test/tests.h + $(CC) $(UCFLAGS) $(LDFLAGS) -DUNICODE_VERSION='"'`$(PERL) -ne "/^UNICODE_VERSION=/ and print $$';" data/Makefile`'"' test/misc.c test/tests.o -lutf8proc -o $@ + +check: test/normtest test/graphemetest test/printproperty test/case test/custom test/charwidth test/misc test/valid test/iterate bench/util.c bench/util.h + test/charwidth + test/valid + test/iterate + test/case + test/custom diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..fb8a730 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,3 @@ +Test-Command: make -f debian/tests/Makefile +Depends: @, build-essential +Restrictions: allow-stderr -- 2.30.2