# Test makefile for the gif2png test images
#
IMAGESTEMS = 666666 ducks gtcd ten-wire

.PHONY: test gif2png-test web2png-test blink make-checkimages clean

test: gif2png-test web2png-test

# The special comparison utility is required because between the Go compilers
# 1.26 and 1.27 versions, it changed the way it did compression. So Binary
# comparison of compressed files isn't reliable across theboundaey.
gif2png-test:
	go build -o pngcmp pngcmp.go
	python3 -m unittest -v test_gif2png.py

# Run this as a visual check. The thing to do is 'Next' a couple times 
# on each pair to verify that the image and its conversion are visually 
# identical.
blink:
	for x in $(IMAGESTEMS); do display $${x}.gif $${x}.png-check; done

# Run this to make a set of check images with a known-good version
make-checkimages:
	for x in $(IMAGESTEMS); do mv $${x}.png $${x}.png-check; done

web2png-test:
	python3 -m unittest -v test_web2png.py

clean: 
	rm -f $(addsuffix .png,$(IMAGESTEMS)) *.bak pngcmp
