interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / test / run-wordcount.sh

78 lines · 2176 bytes Raw Blame History
1#!/bin/sh
2#
3# This script runs the wordcount program in different ways, comparing
4# 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;
11fi
12
13# Do test runs
14#
15rm -f wcdb1.db
16./wordcount --timer --summary wcdb1.db $* --insert >wc-out.txt
17mv wc-out.txt wc-baseline.txt
18rm -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;
24 fi
25
26rm -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;
32 fi
33rm -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;
39 fi
40
41rm -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;
47 fi
48
49rm -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;
55 fi
56
57./wordcount --timer --summary wcdb1.db $* --query >wc-out.txt
58mv 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;
64 fi
65
66./wordcount --timer --summary wcdb1.db $* --delete >wc-out.txt
67mv 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;
73 fi
74
75
76# Clean up temporary files created.
77#
78rm -rf wcdb1.db wcdb2.db wc-out.txt wc-baseline.txt