mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
add --clean-start option to speed testing
This commit is contained in:
parent
985f7bfea0
commit
5bec10048b
1 changed files with 12 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
set -u -e
|
||||
|
||||
LOGDIR=$(basename $0)_logs
|
||||
APP_NEW=""
|
||||
APP_NEW_PARAMS=""
|
||||
NGAMES=""
|
||||
|
@ -39,6 +40,13 @@ declare -a APPS_OLD
|
|||
declare -a DICTS
|
||||
declare -A CHECKED_ROOMS
|
||||
|
||||
function cleanup() {
|
||||
echo "cleaning everything up...."
|
||||
rm -f $(dirname $0)/../../relay/xwrelay.log
|
||||
rm -rf ${LOGDIR}
|
||||
echo "delete from games;" | psql -q -t xwgames
|
||||
}
|
||||
|
||||
function connName() {
|
||||
LOG=$1
|
||||
grep 'got_connect_cmd: connName' $LOG | \
|
||||
|
@ -514,6 +522,7 @@ function getArg() {
|
|||
function usage() {
|
||||
[ $# -gt 0 ] && echo "Error: $1" >&2
|
||||
echo "Usage: $(basename $0) \\" >&2
|
||||
echo " [--clean-start] \\" >&2
|
||||
echo " [--game-dict <path/to/dict>]* \\" >&2
|
||||
echo " [--old-app <path/to/app]* \\" >&2
|
||||
echo " [--new-app <path/to/app] \\" >&2
|
||||
|
@ -538,6 +547,9 @@ function usage() {
|
|||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case $1 in
|
||||
--clean-start)
|
||||
cleanup
|
||||
;;
|
||||
--num-games)
|
||||
NGAMES=$(getArg $*)
|
||||
shift
|
||||
|
@ -620,7 +632,6 @@ done
|
|||
[ -n "$SEED" ] && RANDOM=$SEED
|
||||
[ -z "$ONEPER" -a $NROOMS -lt $NGAMES ] && usage "use --one-per if --num-rooms < --num-games"
|
||||
|
||||
LOGDIR=$(basename $0)_logs
|
||||
RESUME=""
|
||||
for FILE in $(ls $LOGDIR/*.{xwg,txt} 2>/dev/null); do
|
||||
if [ -e $FILE ]; then
|
||||
|
|
Loading…
Reference in a new issue