aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-07-11 12:17:55 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-07-11 12:17:55 +0200
commit82daa91f1c1d80728dfac10aeb86390bd8179ad5 (patch)
treec5ffc88ae06f1efd2ea1bfcc19074d626853b30c
parent729940e9c3d64ce4cac644ffc034891ea2d8439a (diff)
downloadcqrlogo-82daa91f1c1d80728dfac10aeb86390bd8179ad5.tar.gz
cqrlogo-82daa91f1c1d80728dfac10aeb86390bd8179ad5.tar.zst
add some more tests
-rw-r--r--Makefile81
1 files changed, 77 insertions, 4 deletions
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