summaryrefslogtreecommitdiffstats
path: root/test/run-wordcount.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:07:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:07:11 +0000
commit63847496f14c813a5d80efd5b7de0f1294ffe1e3 (patch)
tree01c7571c7c762ceee70638549a99834fdd7c411b /test/run-wordcount.sh
parentInitial commit. (diff)
downloadsqlite3-63847496f14c813a5d80efd5b7de0f1294ffe1e3.tar.xz
sqlite3-63847496f14c813a5d80efd5b7de0f1294ffe1e3.zip
Adding upstream version 3.45.1.upstream/3.45.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/run-wordcount.sh')
-rw-r--r--test/run-wordcount.sh78
1 files changed, 78 insertions, 0 deletions
diff --git a/test/run-wordcount.sh b/test/run-wordcount.sh
new file mode 100644
index 0000000..1755d58
--- /dev/null
+++ b/test/run-wordcount.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# This script runs the wordcount program in different ways, comparing
+# the output from each.
+#
+
+# Select the source text to be analyzed.
+#
+if test "x$1" = "x";
+then echo "Usage: $0 FILENAME [ARGS...]"; exit 1;
+fi
+
+# Do test runs
+#
+rm -f wcdb1.db
+./wordcount --timer --summary wcdb1.db $* --insert >wc-out.txt
+mv wc-out.txt wc-baseline.txt
+rm -f wcdb2.db
+./wordcount --timer --summary wcdb2.db $* --insert --without-rowid >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+
+rm -f wcdb1.db
+./wordcount --timer --summary wcdb1.db $* --replace >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+rm -f wcdb2.db
+./wordcount --timer --summary wcdb2.db $* --replace --without-rowid >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+
+rm -f wcdb1.db
+./wordcount --timer --summary wcdb1.db $* --select >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+
+rm -f wcdb2.db
+./wordcount --timer --summary wcdb2.db $* --select --without-rowid >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+
+./wordcount --timer --summary wcdb1.db $* --query >wc-out.txt
+mv wc-out.txt wc-baseline.txt
+./wordcount --timer --summary wcdb2.db $* --query --without-rowid >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+
+./wordcount --timer --summary wcdb1.db $* --delete >wc-out.txt
+mv wc-out.txt wc-baseline.txt
+./wordcount --timer --summary wcdb2.db $* --delete --without-rowid >wc-out.txt
+ if cmp -s wc-out.txt wc-baseline.txt;
+ then echo hi >/dev/null;
+ else echo ERROR:;
+ diff -u wc-baseline.txt wc-out.txt;
+ fi
+
+
+# Clean up temporary files created.
+#
+rm -rf wcdb1.db wcdb2.db wc-out.txt wc-baseline.txt