# Test suite for cvs2cl.

prog=../cvs2cl.pl 

default: test

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

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

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

test-2:
	@# Olivier Vit's XML bug
	@${prog} --stdin --stdout -r -b --xml -l     \
                 "-d"">2000-03-22;today<"""          \
            < log-2.txt > tmp-2a.xml
	@if cmp tmp-2a.xml out-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} --stdin --stdout < log-3.txt > tmp-3a.txt
	@if cmp tmp-3a.txt out-3a.txt; then \
           rm tmp-3a.txt; \
        fi
	@# Then test with tags/branches/revisions
	@${prog} -r -b -t --stdin --stdout < log-3.txt > tmp-3b.txt
	@if cmp tmp-3b.txt out-3b.txt; then \
           rm tmp-3b.txt; \
        fi

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