📄 qutesthj
字号:
#! /bin/csh -f# qutest: QU layer test script# This is the test script for the QU layer. If you are using the# instructional Suns, then it shouldn't be necessary to make# any changes to this script. If not, then read the descriptions of# DATADIR and TESTSDIR (below) to see if you need to change it (you# should only need to make changes to DATADIR and TESTSDIR).### DATADIR: This is the directory where the data files are. #set DATADIR = ./data## TESTSDIR: This is the directory where the files of test queries# are. #set TESTSDIR = ./testqueries## Don't change this, unless you want to go and change all of the# queries in the test files.#set LOCALNAME = data## The names of the 3 front-end utilities#set DBCREATE = ./dbcreateset DBDESTROY = ./dbdestroyset UBASE = ./ubase## Before doing anything else, we have to create a symbolic link to the# data directory if one doesn't already exist. This is because the# test queries expect to find the data files in a directory called# `data'.#if ( -d data ) goto DATAOKecho You need to have a directory called \`$LOCALNAME\' in order \ to run this script.echo -n "Shall I create one? (y or n) "if ( $< == n ) then echo $0 aborted exit 1endifecho ''if ( ! -d $DATADIR ) then echo I can not find a directory called $DATADIR. \ Please check the value of the DATADIR variable \ in the $0 script and try again. | fmt exit 1endifif ( ! -r $DATADIR/soaps.data ) then echo I can not find the necessary data files in $DATADIR. \ Please check the value of the DATADIR variable in \ the $0 script and try again. | fmt exit 1endifln -s $DATADIR $LOCALNAME >& /dev/nullif ( $status == 0 ) goto DATAOKif ( ! -w . ) then echo You do not have permission to create files in this \ 'directory. Please fix the permissions and rerun \ this script. | fmt exit 1endifecho I can not make the directory. If you have a file called \ \`$LOCALNAME\' in this directory, remove it and run this \ script again. If not, please send mail to cs564. | fmtexit 1DATAOK:## Now that the data directory is set up, make sure that the TESTSDIR# variable is set to something reasonable#if ( ! -d $TESTSDIR ) then echo The TESTSDIR variable is currently set to \ $TESTSDIR, which is not a valid directory. \ Please read the instructions at the top of the \ $0 script, set 'TESTDIR' correctly, and rerun the \ script. | fmt exit 1endifif ( `ls $TESTSDIR/qu.[0-9]* | wc -l` == 0 ) then echo I can not find the QU test files in $TESTSDIR. \ Please read the instructions at the beginning \ of the $0 script, set TESTDIR correctly, and rerun \ the script | fmt exit 1endif## This is the name of the data base we will be using for the tests.#set TESTDB = testdb## Run the requested tests### if no args given, then run all tests#if ( $#argv == 0 ) then foreach queryfile ( `ls $TESTSDIR/qu.*` ) echo running test '#' $queryfile:e '****************' $DBCREATE $TESTDB $UBASE $TESTDB HJ < $queryfile echo "y" | $DBDESTROY $TESTDB end## otherwise, run just the specified tests#else foreach testnum ( $* ) if ( -r $TESTSDIR/qu.$testnum ) then echo running test '#' $testnum '****************' $DBCREATE $TESTDB $UBASE $TESTDB HJ < $TESTSDIR/qu.$testnum echo "y" | $DBDESTROY $TESTDB else echo I can not find a test number $testnum. endif endendif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -