Debian Codegraph @

tests/namazu-cgi-2

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Test for namazu.cgi. Two indices are searched at once.
4 #
5 LOG=`pwdscip-shell system . . pwd.`/test-log
6 echoscip-shell system . . echo. ' *** starting ' $0 >>$LOG
7 . ${srcdir}/commonfuncs
8
9 docnum=`perlscip-shell system . . perl. -lne 'print $1 if /^files (\d+)/' "idx1/NMZ.status"`
10 docnum=`exprscip-shell system . . expr. $docnum + $docnum`
11
12 pwd=`pwdscip-shell system . . pwd.`
13
14 tmprc="$pwd/../src/.namazurc"
15 echoscip-shell system . . echo. "Index $pwd" > $tmprc
16 echoscip-shell system . . echo. "Template $pwd/idx1" >> $tmprc
17 duprcs
18
19 SCRIPT_NAME='namazu.cgi'
20 QUERY_STRING='query=namazu&idxname=idx1&idxname=idx2'
21 export SCRIPT_NAME QUERY_STRING
22
23 cd ../src
24 hitnum=`./namazu.cgi | perlscip-shell system . . perl. -ne 'print $1 if /<!-- HIT -->(\d+)<!-- HIT -->/'`
25 rmscip-shell system . . rm. -f $tmprc
26
27 echoscip-shell system . . echo. "docnum:" $docnum, "hitnum:" $hitnum >> $LOG
28 testscip-shell system . . test. "$docnum" != "$hitnum" && exit 1 # error if not equal
29 exit 0