annotate tests/0042/run-test.sh @ 770:c54bc2ffbf92 tip

update tags
author convert-repo
date Fri, 16 Dec 2011 11:34:01 +0000
parents da901c62e569
children
rev   line source
mas01mc@339 1 #! /bin/bash
mas01mc@339 2
mas01mc@339 3 . ../test-utils.sh
mas01mc@339 4
mas01mc@339 5 if [ -f testdb ]; then rm -f testdb; fi
mas01mc@339 6
mas01mc@339 7 # Make LARGE_ADB
mas01mc@339 8 ${AUDIODB} -d testdb -N --ntracks 50000
mas01mc@339 9 ${AUDIODB} -d testdb -P
mas01mc@339 10 ${AUDIODB} -d testdb -L
mas01mc@339 11
mas01mc@339 12 ${AUDIODB} -d testdb -S | grep "flags:" > testoutput
mas01mc@339 13 echo "flags: l2norm[on] minmax[off] power[on] times[off] largeADB[on]" > test-expected-output
mas01mc@339 14 cmp testoutput test-expected-output
mas01mc@339 15
mas01mc@339 16 intstring 2 > testfeature
mas01mc@339 17 floatstring 0 1 >> testfeature
mas01mc@339 18 floatstring 1 0 >> testfeature
mas01mc@339 19 floatstring 1 0 >> testfeature
mas01mc@339 20 floatstring 0 1 >> testfeature
mas01mc@339 21
mas01mc@339 22 intstring 1 > testpower
mas01mc@339 23 floatstring -0.5 >> testpower
mas01mc@339 24 floatstring -1 >> testpower
mas01mc@339 25 floatstring -1 >> testpower
mas01mc@339 26 floatstring -0.5 >> testpower
mas01mc@339 27
mas01mc@339 28 echo testfeature > testList.txt
mas01mc@339 29 echo testpower > pwrList.txt
mas01mc@339 30 echo key1 > keyList.txt
mas01mc@339 31
mas01mc@339 32 echo testfeature >> testList.txt
mas01mc@339 33 echo testpower >> pwrList.txt
mas01mc@339 34 echo key2 >> keyList.txt
mas01mc@339 35
mas01mc@339 36 ${AUDIODB} -d testdb -B -F testList.txt -W pwrList.txt -K keyList.txt
mas01mc@339 37 # Cleanup
mas01mc@339 38 rm testList.txt pwrList.txt keyList.txt
mas01mc@339 39
mas01mc@339 40 echo "query points (0.0,0.5),(0.0,0.5),(0.5,0.0)"
mas01mc@339 41 intstring 2 > testquery
mas01mc@339 42 floatstring 0 0.5 >> testquery
mas01mc@339 43 floatstring 0 0.5 >> testquery
mas01mc@339 44 floatstring 0.5 0 >> testquery
mas01mc@339 45
mas01mc@339 46 # LARGE_ADB requires an INDEX
mas01mc@339 47 ${AUDIODB} -d testdb -X -R 1 -l 1
mas01mc@339 48
mas01mc@339 49 # LARGE_ADB query from key
mas01mc@339 50 ${AUDIODB} -d testdb -Q sequence -l 1 -k key1 -R 1 --absolute-threshold -4.5 > testoutput
mas01mc@339 51 echo key2 1 > test-expected-output
mas01mc@339 52 cmp testoutput test-expected-output
mas01mc@339 53
mas01mc@339 54 # LARGE_ADB query from feature file and power file
mas01mc@339 55 ${AUDIODB} -d testdb -Q sequence -l 1 -f testquery -w testpower -R 1 --absolute-threshold -4.5 > testoutput
mas01mc@339 56 echo key1 1 > test-expected-output
mas01mc@339 57 echo key2 1 >> test-expected-output
mas01mc@339 58 cmp testoutput test-expected-output
mas01mc@339 59
mas01mc@339 60 # WS
mas01mc@339 61 WSPORT=10020
mas01mc@339 62 start_server ${AUDIODB} ${WSPORT}
mas01mc@339 63
mas01mc@339 64 # LARGE_ADB WS query from key
mas01mc@339 65 ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 1 -k key1 -R 1 --absolute-threshold -4.5 -n 1 --lsh_exact > testoutput
mas01mc@339 66 echo key2 0 0 0 > test-expected-output
mas01mc@339 67 cmp testoutput test-expected-output
mas01mc@339 68
mas01mc@339 69 # LARGE_ADB WS query from feature file and power file tests
mas01mc@339 70 ${AUDIODB} -c localhost:${WSPORT} -d testdb -Q sequence -l 1 -f testquery -w testpower -R 1 --absolute-threshold -4.5 -n 1 > testoutput
mas01mc@339 71 echo key1 1 > test-expected-output
mas01mc@339 72 echo key2 1 >> test-expected-output
mas01mc@339 73 cmp testoutput test-expected-output
mas01mc@339 74
mas01mc@339 75 stop_server $!
mas01mc@339 76
mas01mc@339 77 exit 104