From 82daa91f1c1d80728dfac10aeb86390bd8179ad5 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 11 Jul 2013 12:17:55 +0200 Subject: add some more tests --- Makefile | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 40b6d6e..365c0e9 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ RM := rm ZBARIMG := zbarimg SED := sed GREP := grep +FILE := file CFLAGS += -O2 -Wall -Werror CFLAGS += $(shell pkg-config --cflags --libs libpng) \ $(shell pkg-config --cflags --libs zlib) \ @@ -24,11 +25,83 @@ install: $(INSTALL) -D -m0755 cqrlogo $(DESTDIR)/usr/share/webapps/cqrlogo/cqrlogo check: + $(eval SERVER := www.eworm.de) $(RM) -f check.png - SERVER_NAME=www.eworm.de HTTP_REFERER=http://www.eworm.de/ \ - QUERY_STRING='scale=2&border=1' ./cqrlogo | $(SED) '1,2d' > \ - check.png && $(ZBARIMG) --raw -q check.png | $(GREP) -e \ - '^http://www.eworm.de/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + ./cqrlogo | $(SED) '1,2d' > check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=0' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=4' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=10' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=2&border=0' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=2&border=2' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=2&border=10' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=2&border=10&level=0' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=2&border=10&level=2' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=$(SERVER) HTTP_REFERER=http://$(SERVER)/ \ + QUERY_STRING='scale=2&border=10&level=4' \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | $(GREP) -e '^http://$(SERVER)/$$' + + SERVER_NAME=eworm.net HTTP_REFERER=http://$(SERVER)/ \ + ./cqrlogo | $(SED) '1,2d' > \ + check.png + $(FILE) check.png | $(GREP) 'PNG image data' + $(ZBARIMG) --raw -q check.png | \ + $(GREP) -e '^This QR Code has been stolen from eworm.net!$$' clean: $(RM) -f *.o *~ cqrlogo -- cgit v1.2.3-70-g09d2