# Test suite for cvs2cl.

prog=../cvs2cl.pl 

default: test

test: test-1 test-2 test-3 test-4 test-5

test-1:
	@# Plain output
	@${prog} --utc --stdin --stdout < log-1.txt > tmp-1a.txt
	@if diff -c out-1a.txt tmp-1a.txt; then \
           rm tmp-1a.txt; \
        fi

	@# XML output
	@${prog} --utc --stdin --stdout --xml < log-1.txt > tmp-1a.xml
	@if diff -c out-1a.xml tmp-1a.xml; then \
           rm tmp-1a.xml; \
        fi

test-2:
	@# Olivier Vit's XML bug
	@${prog} --utc --stdin --stdout -r -b --xml -l     \
                 "-d"">2000-03-22;today<"""          \
            < log-2.txt > tmp-2a.xml
	@if diff -c out-2a.xml tmp-2a.xml; then \
           rm tmp-2a.xml; \
        fi

test-3:
	@# Shlomo Reinstein's logs.  He had some filename/directory
	@# bugs, and also has some pretty massive tagnames.
	@#
	@# First, test plain output
	@${prog} --utc --stdin --stdout < log-3.txt > tmp-3a.txt
	@if diff -c out-3a.txt tmp-3a.txt; then \
           rm tmp-3a.txt; \
        fi
	@# Then test with tags/branches/revisions
	@${prog} --utc -r -b -t --stdin --stdout < log-3.txt > tmp-3b.txt
	@if diff -c out-3b.txt tmp-3b.txt; then \
           rm tmp-3b.txt; \
        fi

test-4:
	@# Test --fsf option.
	@${prog} --utc --fsf -S --stdin --stdout < log-4.txt > tmp-4a.txt
	@if diff -c out-4a.txt tmp-4a.txt; then \
           rm tmp-4a.txt; \
        fi
	@# Then test with revisions
	@${prog} --utc --fsf -S -r --stdin --stdout < log-4.txt > tmp-4b.txt
	@if diff -c out-4b.txt tmp-4b.txt; then \
           rm tmp-4b.txt; \
        fi
	@# Then test xml output
	@${prog} --utc --fsf --xml -r --stdin --stdout < log-4.txt > tmp-4c.txt
	@if diff -c out-4c.txt tmp-4c.txt; then \
           rm tmp-4c.txt; \
        fi

test-5:
	@# More tests of the --fsf option.
	@${prog} --utc --fsf -r --stdin --stdout < log-5.txt > tmp-5a.txt
	@if diff -c out-5a.txt tmp-5a.txt; then \
           rm tmp-5a.txt; \
        fi
	@${prog} --utc -S --fsf -r --stdin --stdout < log-5.txt > tmp-5b.txt
	@if diff -c out-5b.txt tmp-5b.txt; then \
           rm tmp-5b.txt; \
        fi
