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

sping at svn.xiph.org sping at svn.xiph.org
Tue Sep 2 17:07:39 PDT 2008


Author: sping
Date: 2008-09-02 17:07:39 -0700 (Tue, 02 Sep 2008)
New Revision: 15246

Modified:
   trunk/xspf/testcase/schema_test.sh
Log:
Add checks and update to Relax NG Schema 0.7

Modified: trunk/xspf/testcase/schema_test.sh
===================================================================
--- trunk/xspf/testcase/schema_test.sh	2008-09-02 23:53:46 UTC (rev 15245)
+++ trunk/xspf/testcase/schema_test.sh	2008-09-03 00:07:39 UTC (rev 15246)
@@ -10,10 +10,10 @@
 # Config
 # -----------------------------------------------------------------------------
 SCHEMA_PATH="../../../websites/xspf.org/validation"
-RNC_0_FILE="${SCHEMA_PATH}/xspf-0_0.6.rnc"
-RNC_1_FILE="${SCHEMA_PATH}/xspf-1_0.6.rnc"
-RNG_0_FILE="${SCHEMA_PATH}/xspf-0_0.6.rng"
-RNG_1_FILE="${SCHEMA_PATH}/xspf-1_0.6.rng"
+RNC_0_FILE="${SCHEMA_PATH}/xspf-0_0.7.rnc"
+RNC_1_FILE="${SCHEMA_PATH}/xspf-1_0.7.rnc"
+RNG_0_FILE="${SCHEMA_PATH}/xspf-0_0.7.rng"
+RNG_1_FILE="${SCHEMA_PATH}/xspf-1_0.7.rng"
 XSD_FILE="${SCHEMA_PATH}/xspf-1_0.2.xsd"
 FAIL_0_FILES="for_version_0/fail/*.xspf"
 PASS_0_FILES="for_version_0/pass/*.xspf"
@@ -21,6 +21,11 @@
 PASS_1_FILES="for_version_1/pass/*.xspf"
 LOG_FILE="schema_test_log.txt"
 
+if [[ ! -d "${SCHEMA_PATH}" ]]; then
+	echo "ERROR: Schema dir missing"
+	echo "Run $ svn co http://svn.xiph.org/websites/xspf.org/validation ${SCHEMA_PATH}/"
+	exit 1
+fi
 
 
 # -----------------------------------------------------------------------------
@@ -37,7 +42,6 @@
 CHECK_PY=../../../websites/validator.xspf.org/check.py
 
 
-
 # -----------------------------------------------------------------------------
 # Reset log
 # -----------------------------------------------------------------------------
@@ -49,10 +53,29 @@
 # Versions
 # -----------------------------------------------------------------------------
 echo "===== Versions =====" >> ${LOG_FILE}
+if [[ ! -f ${RNV} && `which ${RNV}` == "" ]]; then
+	echo "ERROR: RNV missing" ; exit 1
+fi
 echo "RNV "`${RNV} -v 2>&1 | grep version | sed -r "s/rnv version (.+)/\1/"` >> ${LOG_FILE}
+
+if [ ! ${XMLLINT} --version &>/dev/null ]; then
+	echo "ERROR: xmllint missing" ; exit 1
+fi
 echo "xmllint #"`${XMLLINT} --version 2>&1 | grep version | sed -r "s/[^0-9]+//"` >> ${LOG_FILE}
+
+if [ ! ${XML_STARLET} --version &>/dev/null ]; then
+	echo "ERROR: XMLStarlet missing" ; exit 1
+fi
 echo "XMLStarlet "`${XML_STARLET} --version` >> ${LOG_FILE}
+
+if [ ! ${SPIFF_CHECK} --version &>/dev/null ]; then
+	echo "ERROR: spiff_check missing" ; exit 1
+fi
 echo "spiff_check "`${SPIFF_CHECK} --version | sed -r "s/[^0-9]+//"` >> ${LOG_FILE}
+
+if [ ! -f "${CHECK_PY}" ]; then
+	echo "ERROR: check.py missing" ; exit 1
+fi
 echo "check.py r"`svn info ${CHECK_PY} | grep "Revision:" | sed -r "s/Revision: (.+)/\1/"` >> ${LOG_FILE}
 echo "" >> ${LOG_FILE}
 
@@ -98,31 +121,21 @@
 echo "" >> ${LOG_FILE}
 
 echo "===== XSPF-0, Relax NG XML, xmllint, 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
+# NO TEST CASES
 echo "" >> ${LOG_FILE}
 
 
 
 echo "===== XSPF-0, without schema, spiff_check, should have failed =====" >> ${LOG_FILE}
 for i in ${FAIL_0_FILES}; do
-	OUTPUT=`cat $i | ${SPIFF_CHECK} -`
-	if [ "${OUTPUT}" == "Valid XSPF-0." ]; then
+	if ${SPIFF_CHECK} - < "${i}" >/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
 echo "" >> ${LOG_FILE}
 
 echo "===== XSPF-0, without schema, spiff_check, should have passed =====" >> ${LOG_FILE}
-#for i in ${PASS_0_FILES}; do
-#	OUTPUT=`cat $i | ${SPIFF_CHECK} -`
-#	if [ "${OUTPUT}" != "Valid XSPF-0." ]; then
-#		echo $i >> ${LOG_FILE}
-#	fi
-#done
+# NO TEST CASES
 echo "" >> ${LOG_FILE}
 
 
@@ -136,11 +149,7 @@
 echo "" >> ${LOG_FILE}
 
 echo "===== XSPF-0, without schema, check.py, should have passed =====" >> ${LOG_FILE}
-#for i in ${PASS_0_FILES}; do
-#	if ! ${CHECK_PY} --shell $i &>/dev/null ; then
-#		echo $i >> ${LOG_FILE}
-#	fi
-#done
+# NO TEST CASES
 echo "" >> ${LOG_FILE}
 
 
@@ -221,8 +230,7 @@
 
 echo "===== XSPF-1, without schema, spiff_check, should have failed =====" >> ${LOG_FILE}
 for i in ${FAIL_1_FILES}; do
-	OUTPUT=`cat $i | ${SPIFF_CHECK} -`
-	if [ "${OUTPUT}" == "Valid XSPF-1." ]; then
+	if ${SPIFF_CHECK} - < "${i}" >/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
@@ -230,8 +238,7 @@
 
 echo "===== XSPF-1, without schema, spiff_check, should have passed =====" >> ${LOG_FILE}
 for i in ${PASS_1_FILES}; do
-	OUTPUT=`cat $i | ${SPIFF_CHECK} -`
-	if [ "${OUTPUT}" != "Valid XSPF-1." ]; then
+	if ! ${SPIFF_CHECK} - < "${i}" >/dev/null ; then
 		echo $i >> ${LOG_FILE}
 	fi
 done
@@ -261,4 +268,5 @@
 # Show log
 # -----------------------------------------------------------------------------
 cat ${LOG_FILE}
+exit 0
 



More information about the commits mailing list