1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Add batch-runner.js for running batch SQL scripts with timing info.

FossilOrigin-Name: 11f3ed61150c5940da6c157e5063e70c3aa0628dfd0023c47bb65b00af74ab1f
This commit is contained in:
stephan
2022-08-29 12:39:34 +00:00
parent f2e624ea91
commit 2cae138fba
6 changed files with 333 additions and 9 deletions

View File

@ -0,0 +1,11 @@
#!/bin/bash
# Expects $1 to be a (speedtest1 --script) output file. Output is a
# series of SQL files extracted from that file.
infile=${1:?arg = speedtest1 --script output file}
testnums=$(grep -e '^-- begin test' "$infile" | cut -d' ' -f4)
#echo testnums=$testnums
for n in $testnums; do
ofile=$(printf "speedtest1-%03d.sql" $n)
sed -n -e "/^-- begin test $n\$/,/^-- end test $n\$/p" $infile > $ofile
echo -e "$n\t$ofile"
done