annotate tests/0027/run-test.sh @ 373:cd63493c32a9

Add library SONAME versioning. This has the unfortunate effect of altering how the linker and the runtime library resolver find relevant files, which has effects on how the library test suite should be run. So... ... also rework how to run libtests. Start by deleting 28 almost-identical copies of Makefile and run-test.sh, and also the completely useless copy of test-utils.sh. Then: * library tests assume the existence of ../libtest.mk, a file with make syntax; * ../libtest.mk is responsible for providing enough symbolic links to con the linker and the runtime resolver into finding our library; * the default way of doing that is by using the -rpath linker flag. * run-tests.sh converts from test1 success convention ("return 0") to tests success convention ("exit 104") * clean.sh cleans up our symbolic links. This test regime stands a reasonable chance of running on OS X eventually, and a snowball's chance in heaven (remember, heaven is hotter than hell) on Windows. It should still be straightforward to merge libtests/ into tests/ when that is appropriate. Don't forget to add ../libtest.mk
author mas01cr
date Thu, 13 Nov 2008 17:09:51 +0000
parents fe4dc39b2dd7
children
rev   line source
mas01cr@252 1 #! /bin/bash
mas01cr@193 2
mas01cr@193 3 . ../test-utils.sh
mas01cr@193 4
mas01cr@193 5 if [ -f testdb ]; then rm -f testdb; fi
mas01cr@193 6
mas01cr@193 7 ${AUDIODB} -d testdb -N
mas01cr@193 8
mas01cr@193 9 intstring 2 > testfeature
mas01cr@193 10 floatstring 0 1 >> testfeature
mas01cr@193 11 floatstring 1 0 >> testfeature
mas01cr@193 12
mas01cr@193 13 intstring 1 > testpower
mas01cr@193 14 floatstring -0.5 >> testpower
mas01cr@193 15 floatstring -1 >> testpower
mas01cr@193 16
mas01cr@193 17 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01cr@193 18
mas01cr@193 19 ${AUDIODB} -d testdb -P
mas01cr@193 20
mas01cr@193 21 expect_clean_error_exit ${AUDIODB} -d testdb -I -f testfeature
mas01cr@193 22
mas01cr@193 23 ${AUDIODB} -d testdb -I -f testfeature -w testpower
mas01cr@193 24
mas01cr@193 25 # sequence queries require L2NORM
mas01cr@193 26 ${AUDIODB} -d testdb -L
mas01cr@193 27
mas01cr@193 28 # queries without power files should run as before
mas01cr@193 29 echo "query point (0.0,0.5)"
mas01cr@193 30 intstring 2 > testquery
mas01cr@193 31 floatstring 0 0.5 >> testquery
mas01cr@193 32
mas01cr@193 33 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery > testoutput
mas01cr@193 34 echo testfeature 1 0 0 > test-expected-output
mas01cr@193 35 cmp testoutput test-expected-output
mas01cr@193 36 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput
mas01cr@193 37 echo testfeature 0 0 0 > test-expected-output
mas01cr@193 38 cmp testoutput test-expected-output
mas01cr@193 39
mas01cr@193 40 echo "query point (0.5,0.0)"
mas01cr@193 41 intstring 2 > testquery
mas01cr@193 42 floatstring 0.5 0 >> testquery
mas01cr@193 43
mas01cr@193 44 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery > testoutput
mas01cr@193 45 echo testfeature 1 0 1 > test-expected-output
mas01cr@193 46 cmp testoutput test-expected-output
mas01cr@193 47 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -n 1 > testoutput
mas01cr@193 48 echo testfeature 0 0 1 > test-expected-output
mas01cr@193 49 cmp testoutput test-expected-output
mas01cr@193 50
mas01cr@193 51 # queries with power files might do something different
mas01cr@193 52 echo "query point (0.0,0.5), p=-0.5"
mas01cr@193 53 intstring 2 > testquery
mas01cr@193 54 floatstring 0 0.5 >> testquery
mas01cr@193 55
mas01cr@193 56 intstring 1 > testquerypower
mas01cr@193 57 floatstring -0.5 >> testquerypower
mas01cr@193 58
mas01cr@193 59 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-1.4 > testoutput
mas01cr@193 60 echo testfeature 1 0 0 > test-expected-output
mas01cr@193 61 cmp testoutput test-expected-output
mas01cr@193 62
mas01cr@193 63 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.6 > testoutput
mas01cr@193 64 echo testfeature 0 0 0 > test-expected-output
mas01cr@193 65 cmp testoutput test-expected-output
mas01cr@193 66
mas01cr@193 67 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.2 > testoutput
mas01cr@193 68 cat /dev/null > test-expected-output
mas01cr@193 69 cmp testoutput test-expected-output
mas01cr@193 70
mas01cr@193 71 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=1 > testoutput
mas01cr@193 72 echo testfeature 1 0 0 > test-expected-output
mas01cr@193 73 cmp testoutput test-expected-output
mas01cr@193 74
mas01cr@193 75 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=0.2 > testoutput
mas01cr@193 76 echo testfeature 0 0 0 > test-expected-output
mas01cr@193 77 cmp testoutput test-expected-output
mas01cr@193 78
mas01cr@193 79 echo "query point (0.5,0.0), p=-0.5"
mas01cr@193 80 intstring 2 > testquery
mas01cr@193 81 floatstring 0.5 0 >> testquery
mas01cr@193 82
mas01cr@193 83 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-1.4 > testoutput
mas01cr@193 84 echo testfeature 1 0 1 > test-expected-output
mas01cr@193 85 cmp testoutput test-expected-output
mas01cr@193 86
mas01cr@193 87 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.6 > testoutput
mas01cr@193 88 echo testfeature 2 0 0 > test-expected-output
mas01cr@193 89 cmp testoutput test-expected-output
mas01cr@193 90
mas01cr@193 91 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --absolute-threshold=-0.2 > testoutput
mas01cr@193 92 cat /dev/null > test-expected-output
mas01cr@193 93 cmp testoutput test-expected-output
mas01cr@193 94
mas01cr@193 95 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=1 > testoutput
mas01cr@193 96 echo testfeature 1 0 1 > test-expected-output
mas01cr@193 97 cmp testoutput test-expected-output
mas01cr@193 98
mas01cr@193 99 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testquerypower --relative-threshold=0.2 > testoutput
mas01cr@193 100 echo testfeature 2 0 0 > test-expected-output
mas01cr@193 101 cmp testoutput test-expected-output
mas01cr@193 102
mas01cr@193 103 exit 104