From: Adam Dickmeiss Date: Tue, 8 Jan 2013 15:16:37 +0000 (+0100) Subject: Skip ICU based tests when ICU is disabled X-Git-Tag: v1.6.24~3 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=a6fe306bff3150090c4c4d8a1662b01e2fd3c754;p=pazpar2-moved-to-github.git Skip ICU based tests when ICU is disabled And clean up the testing scripts as well. --- diff --git a/test/test_facets.sh b/test/test_facets.sh index b72e8da..c35bbec 100755 --- a/test/test_facets.sh +++ b/test/test_facets.sh @@ -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 diff --git a/test/test_filter.sh b/test/test_filter.sh index 82708c6..ff745df 100755 --- a/test/test_filter.sh +++ b/test/test_filter.sh @@ -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 diff --git a/test/test_http.sh b/test/test_http.sh index 3413346..5d177c7 100755 --- a/test/test_http.sh +++ b/test/test_http.sh @@ -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: diff --git a/test/test_icu.sh b/test/test_icu.sh index b6d63df..46bb6b9 100755 --- a/test/test_icu.sh +++ b/test/test_icu.sh @@ -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 diff --git a/test/test_limit_limitmap.sh b/test/test_limit_limitmap.sh index 3413346..beb294d 100755 --- a/test/test_limit_limitmap.sh +++ b/test/test_limit_limitmap.sh @@ -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 diff --git a/test/test_post.sh b/test/test_post.sh index c25a574..5d177c7 100755 --- a/test/test_post.sh +++ b/test/test_post.sh @@ -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 diff --git a/test/test_preferred.sh b/test/test_preferred.sh index e9899f4..3a2eb98 100755 --- a/test/test_preferred.sh +++ b/test/test_preferred.sh @@ -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 diff --git a/test/test_settings.sh b/test/test_settings.sh index ce6b03a..5d177c7 100755 --- a/test/test_settings.sh +++ b/test/test_settings.sh @@ -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 diff --git a/test/test_solr.sh b/test/test_solr.sh index 4e96d20..b6c74e2 100755 --- a/test/test_solr.sh +++ b/test/test_solr.sh @@ -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: diff --git a/test/test_sort.sh b/test/test_sort.sh index 6ef605a..2ed0501 100755 --- a/test/test_sort.sh +++ b/test/test_sort.sh @@ -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 diff --git a/test/test_termlist_block.sh b/test/test_termlist_block.sh index fb9e31b..ff745df 100755 --- a/test/test_termlist_block.sh +++ b/test/test_termlist_block.sh @@ -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 diff --git a/test/test_turbomarcxml.sh b/test/test_turbomarcxml.sh index 524bd55..5d177c7 100755 --- a/test/test_turbomarcxml.sh +++ b/test/test_turbomarcxml.sh @@ -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 diff --git a/test/test_url.sh b/test/test_url.sh index dd6b88f..beb294d 100755 --- a/test/test_url.sh +++ b/test/test_url.sh @@ -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