AryaWu/sqlite
0
1#!/bin/sh2#3# This script runs the wordcount program in different ways, comparing4# the output from each.5#6 7# Select the source text to be analyzed.8#9if test "x$1" = "x";10then echo "Usage: $0 FILENAME [ARGS...]"; exit 1;11fi12 13# Do test runs14#15rm -f wcdb1.db16./wordcount --timer --summary wcdb1.db $* --insert >wc-out.txt17mv wc-out.txt wc-baseline.txt18rm -f wcdb2.db19./wordcount --timer --summary wcdb2.db $* --insert --without-rowid >wc-out.txt20 if cmp -s wc-out.txt wc-baseline.txt;21 then echo hi >/dev/null;22 else echo ERROR:;23 diff -u wc-baseline.txt wc-out.txt;24 fi25 26rm -f wcdb1.db27./wordcount --timer --summary wcdb1.db $* --replace >wc-out.txt28 if cmp -s wc-out.txt wc-baseline.txt;29 then echo hi >/dev/null;30 else echo ERROR:;31 diff -u wc-baseline.txt wc-out.txt;32 fi33rm -f wcdb2.db34./wordcount --timer --summary wcdb2.db $* --replace --without-rowid >wc-out.txt35 if cmp -s wc-out.txt wc-baseline.txt;36 then echo hi >/dev/null;37 else echo ERROR:;38 diff -u wc-baseline.txt wc-out.txt;39 fi40 41rm -f wcdb1.db42./wordcount --timer --summary wcdb1.db $* --select >wc-out.txt43 if cmp -s wc-out.txt wc-baseline.txt;44 then echo hi >/dev/null;45 else echo ERROR:;46 diff -u wc-baseline.txt wc-out.txt;47 fi48 49rm -f wcdb2.db50./wordcount --timer --summary wcdb2.db $* --select --without-rowid >wc-out.txt51 if cmp -s wc-out.txt wc-baseline.txt;52 then echo hi >/dev/null;53 else echo ERROR:;54 diff -u wc-baseline.txt wc-out.txt;55 fi56 57./wordcount --timer --summary wcdb1.db $* --query >wc-out.txt58mv wc-out.txt wc-baseline.txt59./wordcount --timer --summary wcdb2.db $* --query --without-rowid >wc-out.txt60 if cmp -s wc-out.txt wc-baseline.txt;61 then echo hi >/dev/null;62 else echo ERROR:;63 diff -u wc-baseline.txt wc-out.txt;64 fi65 66./wordcount --timer --summary wcdb1.db $* --delete >wc-out.txt67mv wc-out.txt wc-baseline.txt68./wordcount --timer --summary wcdb2.db $* --delete --without-rowid >wc-out.txt69 if cmp -s wc-out.txt wc-baseline.txt;70 then echo hi >/dev/null;71 else echo ERROR:;72 diff -u wc-baseline.txt wc-out.txt;73 fi74 75 76# Clean up temporary files created.77#78rm -rf wcdb1.db wcdb2.db wc-out.txt wc-baseline.txt79 