[xiph-commits] r12910 - trunk/xspf/testcase

sping at svn.xiph.org sping at svn.xiph.org
Wed May 2 13:44:47 PDT 2007


Author: sping
Date: 2007-05-02 13:44:47 -0700 (Wed, 02 May 2007)
New Revision: 12910

Modified:
   trunk/xspf/testcase/schema_test.sh
Log:
XSPF-0 integration, tree test structure, using installed RNV instead of local one


Modified: trunk/xspf/testcase/schema_test.sh
===================================================================
--- trunk/xspf/testcase/schema_test.sh	2007-05-02 20:26:23 UTC (rev 12909)
+++ trunk/xspf/testcase/schema_test.sh	2007-05-02 20:44:47 UTC (rev 12910)
@@ -10,11 +10,13 @@
 # Config
 # -----------------------------------------------------------------------------
 SCHEMA_PATH="../../../websites/xspf.org/validation"
-RNC_FILE="${SCHEMA_PATH}/xspf-1_0.5.rnc"
-RNG_FILE="${SCHEMA_PATH}/xspf-1_0.5.rng"
+RNC_0_FILE="${SCHEMA_PATH}/xspf-0_0.5.rnc"
+RNC_1_FILE="${SCHEMA_PATH}/xspf-1_0.5.rnc"
+RNG_1_FILE="${SCHEMA_PATH}/xspf-0_0.5.rng"
+RNG_1_FILE="${SCHEMA_PATH}/xspf-1_0.5.rng"
 XSD_FILE="${SCHEMA_PATH}/xspf-1_0.2.xsd"
-PASS_FILES="for_version_1/pass/*.xspf"
-FAIL_FILES="for_version_1/fail/*.xspf"
+PASS_1_FILES="for_version_1/pass/*.xspf"
+FAIL_1_FILES="for_version_1/fail/*.xspf"
 LOG_FILE="schema_test_log.txt"
 
 
@@ -27,7 +29,7 @@
 else
 	XML_STARLET=xmlstarlet
 fi
-RNV=./rnv
+RNV=rnv
 XMLLINT=xmllint
 
 
@@ -40,37 +42,75 @@
 
 
 # -----------------------------------------------------------------------------
-# RNV version
+# Versions
 # -----------------------------------------------------------------------------
-echo "== RNV version ==" >> ${LOG_FILE}
-${RNV} -v 2>> ${LOG_FILE}
+echo "= Versions =" >> ${LOG_FILE}
+echo "RNV "`${RNV} -v 2>&1 | grep version | sed -r "s/rnv version (.+)/\1/"` >> ${LOG_FILE}
+echo "xmllint #"`${XMLLINT} --version 2>&1 | grep version | sed -r "s/[^0-9]+//"` >> ${LOG_FILE}
+echo "XMLStarlet "`${XML_STARLET} --version` >> ${LOG_FILE}
 echo "" >> ${LOG_FILE}
 
 
 
 # -----------------------------------------------------------------------------
-# XMLStarlet version
+# Tests
 # -----------------------------------------------------------------------------
-echo "== XMLStarlet version ==" >> ${LOG_FILE}
-${XML_STARLET} --version >> ${LOG_FILE}
+echo "= Tests =" >> ${LOG_FILE}
 echo "" >> ${LOG_FILE}
+echo "== XSPF-0 ==" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+echo "=== Relax NG Compact ===" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+echo "==== RNV ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
 
+echo "===== Should have failed =====" >> ${LOG_FILE}
+for i in ${FAIL_0_FILES}; do
+	if ${RNV} ${RNC_0_FILE} $i &>/dev/null ; then
+		echo $i >> ${LOG_FILE}
+	fi
+done
+echo "" >> ${LOG_FILE}
 
+echo "===== Should have passed =====" >> ${LOG_FILE}
+for i in ${PASS_0_FILES}; do
+	if ! ${RNV} ${RNC_0_FILE} $i &>/dev/null ; then
+		echo $i >> ${LOG_FILE}
+	fi
+done
+echo "" >> ${LOG_FILE}
 
-# -----------------------------------------------------------------------------
-# Test RNC
-# -----------------------------------------------------------------------------
-echo "== Relax NG Compact - RNV - Should have failed ==" >> ${LOG_FILE}
-for i in ${FAIL_FILES}; do
-	if ${RNV} ${RNC_FILE} $i &>/dev/null ; then
+
+
+echo "=== Relax NG XML ===" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+echo "==== XMLStarlet ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have failed =====" >> ${LOG_FILE}
+${XML_STARLET} validate --err --list-good --relaxng ${RNG_0_FILE} ${FAIL_0_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have passed =====" >> ${LOG_FILE}
+${XML_STARLET} validate --err --list-bad --relaxng ${RNG_0_FILE} ${PASS_0_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "" >> ${LOG_FILE}
+
+
+
+echo "==== xmllint ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have failed =====" >> ${LOG_FILE}
+for i in ${FAIL_0_FILES}; do
+	if ${XMLLINT} --relaxng ${RNG_0_FILE} --noout $i &>/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
 echo "" >> ${LOG_FILE}
 
-echo "== Relax NG Compact - RNV - Should have passed ==" >> ${LOG_FILE}
-for i in ${PASS_FILES}; do
-	if ! ${RNV} ${RNC_FILE} $i &>/dev/null ; then
+echo "===== Should have passed =====" >> ${LOG_FILE}
+for i in ${PASS_0_FILES}; do
+	if ! ${XMLLINT} --relaxng ${RNG_0_FILE} --noout $i &>/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
@@ -78,56 +118,94 @@
 
 
 
-# -----------------------------------------------------------------------------
-# Test RNG
-# -----------------------------------------------------------------------------
-echo "== Relax NG XML - XMLStarlet - Should have failed ==" >> ${LOG_FILE}
-${XML_STARLET} validate --err --list-good --relaxng ${RNG_FILE} ${FAIL_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "== XSPF-1 ==" >> ${LOG_FILE}
 echo "" >> ${LOG_FILE}
+echo "=== Relax NG Compact ===" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+echo "==== RNV ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
 
-echo "== Relax NG XML - XMLStarlet - Should have passed ==" >> ${LOG_FILE}
-${XML_STARLET} validate --err --list-bad --relaxng ${RNG_FILE} ${PASS_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "===== Should have failed =====" >> ${LOG_FILE}
+for i in ${FAIL_1_FILES}; do
+	if ${RNV} ${RNC_1_FILE} $i &>/dev/null ; then
+		echo $i >> ${LOG_FILE}
+	fi
+done
 echo "" >> ${LOG_FILE}
 
-echo "== Relax NG XML - xmllint - Should have failed ==" >> ${LOG_FILE}
-for i in ${FAIL_FILES}; do
-	if ${XMLLINT} --relaxng ${RNG_FILE} --noout $i &>/dev/null ; then
+echo "===== Should have passed =====" >> ${LOG_FILE}
+for i in ${PASS_1_FILES}; do
+	if ! ${RNV} ${RNC_1_FILE} $i &>/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
 echo "" >> ${LOG_FILE}
 
-echo "== Relax NG XML - xmllint - Should have passed ==" >> ${LOG_FILE}
-for i in ${PASS_FILES}; do
-	if ! ${XMLLINT} --relaxng ${RNG_FILE} --noout $i &>/dev/null ; then
+
+
+echo "=== Relax NG XML ===" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+echo "==== XMLStarlet ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have failed =====" >> ${LOG_FILE}
+${XML_STARLET} validate --err --list-good --relaxng ${RNG_1_FILE} ${FAIL_1_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have passed =====" >> ${LOG_FILE}
+${XML_STARLET} validate --err --list-bad --relaxng ${RNG_1_FILE} ${PASS_1_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "" >> ${LOG_FILE}
+
+
+
+echo "==== xmllint ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have failed =====" >> ${LOG_FILE}
+for i in ${FAIL_1_FILES}; do
+	if ${XMLLINT} --relaxng ${RNG_1_FILE} --noout $i &>/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
 echo "" >> ${LOG_FILE}
 
+echo "===== Should have passed =====" >> ${LOG_FILE}
+for i in ${PASS_1_FILES}; do
+	if ! ${XMLLINT} --relaxng ${RNG_1_FILE} --noout $i &>/dev/null ; then
+		echo $i >> ${LOG_FILE}
+	fi
+done
+echo "" >> ${LOG_FILE}
 
 
-# -----------------------------------------------------------------------------
-# Test XSD/WXS
-# -----------------------------------------------------------------------------
-echo "== W3C XML Schema - XMLStarlet - Should have failed ==" >> ${LOG_FILE}
-${XML_STARLET} validate --err --list-good --xsd ${XSD_FILE} ${FAIL_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+
+echo "=== W3C XML Schema ===" >> ${LOG_FILE}
 echo "" >> ${LOG_FILE}
+echo "==== XMLStarlet ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
 
-echo "== W3C XML Schema - XMLStarlet - Should have passed ==" >> ${LOG_FILE}
-${XML_STARLET} validate --err --list-bad --xsd ${XSD_FILE} ${PASS_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "===== Should have failed =====" >> ${LOG_FILE}
+${XML_STARLET} validate --err --list-good --xsd ${XSD_FILE} ${FAIL_1_FILES} 1>> ${LOG_FILE} 2>> /dev/null
 echo "" >> ${LOG_FILE}
 
-echo "== W3C XML Schema - xmllint - Should have failed ==" >> ${LOG_FILE}
-for i in ${FAIL_FILES}; do
+echo "===== Should have passed =====" >> ${LOG_FILE}
+${XML_STARLET} validate --err --list-bad --xsd ${XSD_FILE} ${PASS_1_FILES} 1>> ${LOG_FILE} 2>> /dev/null
+echo "" >> ${LOG_FILE}
+
+
+echo "==== xmllint ====" >> ${LOG_FILE}
+echo "" >> ${LOG_FILE}
+
+echo "===== Should have failed =====" >> ${LOG_FILE}
+for i in ${FAIL_1_FILES}; do
 	if ${XMLLINT} --schema ${XSD_FILE} --noout $i &>/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
 echo "" >> ${LOG_FILE}
 
-echo "== W3C XML Schema - xmllint - Should have passed ==" >> ${LOG_FILE}
-for i in ${PASS_FILES}; do
+echo "===== Should have passed =====" >> ${LOG_FILE}
+for i in ${PASS_1_FILES}; do
 	if ! ${XMLLINT} --schema ${XSD_FILE} --noout $i &>/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi



More information about the commits mailing list