#! /bin/sh

check_dir () {
    dir="$1"
    shift
    xmlfiles=`cd $dir && echo *.xml`
    for file in $xmlfiles; do
        printf "%s" "File $dir/$file: "
	./test_canonxml "$@" "$dir/$file" >out.xml
	if cmp out.xml "$dir/out/$file"; then
	    echo "OK"
	else
	    echo "NOT OK"
	    read
	fi
    done
}

check_dir "data_valid/conditional"
check_dir "data_valid/att_normalization"
check_dir "data_valid/att_normalization" -event-based-atts
check_dir "data_valid/optional_decls"
check_dir "data_valid/comments" -comments
check_dir "data_valid/bugfixes" 

#check_dir "data_jclark_valid/sa-problems"
#check_dir "data_jclark_valid/ext-sa-problems"
check_dir "data_jclark_valid/sa" 
check_dir "data_jclark_valid/not-sa" 
check_dir "data_jclark_valid/ext-sa" 


