Snapshot of upstream SQLite 3.45.3
[sqlcipher.git] / test / run-wordcount.sh
blob1755d58161f67d6665b67a996633c07e5ca6fe7c
1 #!/bin/sh
3 # This script runs the wordcount program in different ways, comparing
4 # the output from each.
7 # Select the source text to be analyzed.
9 if test "x$1" = "x";
10 then echo "Usage: $0 FILENAME [ARGS...]"; exit 1;
13 # Do test runs
15 rm -f wcdb1.db
16 ./wordcount --timer --summary wcdb1.db $* --insert >wc-out.txt
17 mv wc-out.txt wc-baseline.txt
18 rm -f wcdb2.db
19 ./wordcount --timer --summary wcdb2.db $* --insert --without-rowid >wc-out.txt
20 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;
26 rm -f wcdb1.db
27 ./wordcount --timer --summary wcdb1.db $* --replace >wc-out.txt
28 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;
33 rm -f wcdb2.db
34 ./wordcount --timer --summary wcdb2.db $* --replace --without-rowid >wc-out.txt
35 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;
41 rm -f wcdb1.db
42 ./wordcount --timer --summary wcdb1.db $* --select >wc-out.txt
43 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;
49 rm -f wcdb2.db
50 ./wordcount --timer --summary wcdb2.db $* --select --without-rowid >wc-out.txt
51 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;
57 ./wordcount --timer --summary wcdb1.db $* --query >wc-out.txt
58 mv wc-out.txt wc-baseline.txt
59 ./wordcount --timer --summary wcdb2.db $* --query --without-rowid >wc-out.txt
60 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;
66 ./wordcount --timer --summary wcdb1.db $* --delete >wc-out.txt
67 mv wc-out.txt wc-baseline.txt
68 ./wordcount --timer --summary wcdb2.db $* --delete --without-rowid >wc-out.txt
69 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;
76 # Clean up temporary files created.
78 rm -rf wcdb1.db wcdb2.db wc-out.txt wc-baseline.txt