Skip ICU based tests when ICU is disabled
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 8 Jan 2013 15:16:37 +0000 (16:16 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 8 Jan 2013 15:16:37 +0000 (16:16 +0100)
And clean up the testing scripts as well.

13 files changed:
test/test_facets.sh
test/test_filter.sh
test/test_http.sh
test/test_icu.sh
test/test_limit_limitmap.sh
test/test_post.sh
test/test_preferred.sh
test/test_settings.sh
test/test_solr.sh
test/test_sort.sh
test/test_termlist_block.sh
test/test_turbomarcxml.sh
test/test_url.sh

index b72e8da..c35bbec 100755 (executable)
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
@@ -31,8 +32,13 @@ if test ! -f ztest.pid; then
     exit 0
 fi
 
-${srcdir}/run_pazpar2.sh test_facets
-E=$?
+E=0
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       ${srcdir}/run_pazpar2.sh $TEST
+       E=$?
+    fi
+fi
 
 kill `cat ztest.pid`
 rm ztest.pid
index 82708c6..ff745df 100755 (executable)
@@ -4,7 +4,7 @@
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-TEST=test_filter_
+TEST=`basename $0 .sh`
 
 # look for yaz-ztest in PATH
 oIFS=$IFS
@@ -27,17 +27,22 @@ if test -z "$F"; then
 fi
 
 rm -f ztest.pid
-rm -f ${TEST}ztest.log
-$F -l ${TEST}ztest.log -p ztest.pid -D tcp:localhost:9999
+rm -f ${TEST}_ztest.log
+$F -l ${TEST}_ztest.log -p ztest.pid -D tcp:localhost:9999
 sleep 1
 if test ! -f ztest.pid; then
     echo "yaz-ztest could not be started"
     exit 0
 fi
 
-# Test using test_http.cfg
-${srcdir}/run_pazpar2.sh test_filter
-E=$?
+E=0
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       ${srcdir}/run_pazpar2.sh $TEST
+       E=$?
+    fi
+fi
+
 kill `cat ztest.pid`
 rm ztest.pid
 exit $E
index 3413346..5d177c7 100755 (executable)
@@ -1,12 +1,10 @@
-#!/bin/bash
+#!/bin/sh
 #
 
-FILE=`basename $0`
-TEST=${FILE/.sh/}
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-# Test using test_http.cfg
 exec ${srcdir}/run_pazpar2.sh $TEST
 
 # Local Variables:
index b6d63df..46bb6b9 100755 (executable)
@@ -1,12 +1,13 @@
 #!/bin/sh
 #
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
 if test -x ../src/pazpar2; then
     if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
-       exec ${srcdir}/run_pazpar2.sh test_icu
+       exec ${srcdir}/run_pazpar2.sh $TEST
     fi
 fi
 exit 0
index 3413346..beb294d 100755 (executable)
@@ -1,13 +1,15 @@
-#!/bin/bash
+#!/bin/sh
 #
 
-FILE=`basename $0`
-TEST=${FILE/.sh/}
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-# Test using test_http.cfg
-exec ${srcdir}/run_pazpar2.sh $TEST
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       exec ${srcdir}/run_pazpar2.sh $TEST
+    fi
+fi
 
 # Local Variables:
 # mode:shell-script
index c25a574..5d177c7 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/sh
 #
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-# Test using test_http.cfg
-exec ${srcdir}/run_pazpar2.sh test_post
+exec ${srcdir}/run_pazpar2.sh $TEST
 
 # Local Variables:
 # mode:shell-script
index e9899f4..3a2eb98 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-#TODO set up solr target. For now use donut 
-#F=../solr/client.sh 
+#TODO set up solr target. For now use donut
+#F=../solr/client.sh
 #
 #rm -f solr.pid
 #$F -l solr.log -p ztest.pid -D @:9999
@@ -14,22 +15,20 @@ srcdir=${srcdir:-"."}
 #    exit 0
 #fi
 
-TEST=test_preferred_
-
-${srcdir}/run_pazpar2.sh test_preferred
+${srcdir}/run_pazpar2.sh $TEST
 E=$?
 
 grep "has preferred" ${TEST}pazpar2.log | cut -f 4- -d ' ' > test_preferred.log
-# 
-if [ -f test_preferred.res ] ; then 
+
+if [ -f test_preferred.res ] ; then
     diff test_preferred.res test_preferred.log > test_preferred.dif
     E2=$?
-    if [ $E2 -ne 0 ] ; then 
-       echo "has preferred test failed!" 
+    if [ $E2 -ne 0 ] ; then
+       echo "has preferred test failed!"
        E=$E2
     fi
 else
-    echo "Making test_preferred.res for first time." 
+    echo "Making test_preferred.res for first time."
     mv test_preferred.log test_preferred.res
 fi
 
index ce6b03a..5d177c7 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/sh
 #
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-# Test using test_http.cfg
-exec ${srcdir}/run_pazpar2.sh test_settings
+exec ${srcdir}/run_pazpar2.sh $TEST
 
 # Local Variables:
 # mode:shell-script
index 4e96d20..b6c74e2 100755 (executable)
@@ -3,6 +3,8 @@
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
+TEST=`basename $0 .sh`
+
 #TODO set up solr target. For now use donut 
 #F=../solr/client.sh 
 #
@@ -14,11 +16,13 @@ srcdir=${srcdir:-"."}
 #    exit 0
 #fi
 
-${srcdir}/run_pazpar2.sh test_solr
-E=$?
-
-#kill `cat ztest.pid`
-#rm ztest.pid
+E=0
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       ${srcdir}/run_pazpar2.sh $TEST
+       E=$?
+    fi
+fi
 exit $E
 
 # Local Variables:
index 6ef605a..2ed0501 100755 (executable)
@@ -3,10 +3,16 @@
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
+TEST=`basename $0 .sh`
+
 # Using test solr target opencontent-solr
-# 
-${srcdir}/run_pazpar2.sh test_sort
-E=$?
+E=0
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       ${srcdir}/run_pazpar2.sh $TEST
+       E=$?
+    fi
+fi
 
 #kill `cat ztest.pid`
 #rm ztest.pid
index fb9e31b..ff745df 100755 (executable)
@@ -4,7 +4,7 @@
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-TEST=test_termlist_block
+TEST=`basename $0 .sh`
 
 # look for yaz-ztest in PATH
 oIFS=$IFS
@@ -35,9 +35,14 @@ if test ! -f ztest.pid; then
     exit 0
 fi
 
-# Test using test_http.cfg
-${srcdir}/run_pazpar2.sh ${TEST}
-E=$?
+E=0
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       ${srcdir}/run_pazpar2.sh $TEST
+       E=$?
+    fi
+fi
+
 kill `cat ztest.pid`
 rm ztest.pid
 exit $E
index 524bd55..5d177c7 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/sh
 #
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-# Test using test_http.cfg
-exec ${srcdir}/run_pazpar2.sh test_turbomarcxml
+exec ${srcdir}/run_pazpar2.sh $TEST
 
 # Local Variables:
 # mode:shell-script
index dd6b88f..beb294d 100755 (executable)
@@ -1,11 +1,15 @@
 #!/bin/sh
 #
 
+TEST=`basename $0 .sh`
 # srcdir might be set by make
 srcdir=${srcdir:-"."}
 
-# Test using test_http.cfg
-exec ${srcdir}/run_pazpar2.sh test_url
+if test -x ../src/pazpar2; then
+    if ../src/pazpar2 -V |grep icu:enabled >/dev/null; then
+       exec ${srcdir}/run_pazpar2.sh $TEST
+    fi
+fi
 
 # Local Variables:
 # mode:shell-script