Add test coverage report and generate script.

Both of these items were referenced in the README.md, but were not
in the repository.
This commit is contained in:
Dave Collins 2013-05-29 16:20:06 -05:00
parent e30ceb5947
commit c97c8f17a4
2 changed files with 68 additions and 0 deletions

17
cov_report.sh Normal file
View file

@ -0,0 +1,17 @@
#!/bin/sh
# This script uses gocov to generate a test coverage report.
# The gocov tool my be obtained with the following command:
# go get github.com/axw/gocov/gocov
#
# It will be installed to $GOPATH/bin, so ensure that location is in your $PATH.
# Check for gocov.
type gocov >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo >&2 "This script requires the gocov tool."
echo >&2 "You may obtain it with the following command:"
echo >&2 "go get github.com/axw/gocov/gocov"
exit 1
fi
(cd sqlite3 && gocov test | gocov report)

51
test_coverage.txt Normal file
View file

@ -0,0 +1,51 @@
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.NewestSha 100.00% (25/25)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.endTx 100.00% (20/20)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.close 100.00% (9/9)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.txop 100.00% (7/7)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.fetchTxCache 100.00% (7/7)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteBlockIterator.Row 100.00% (7/7)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.FetchTxByShaList 100.00% (6/6)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.InvalidateTxCache 100.00% (5/5)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.InvalidateBlockCache 100.00% (5/5)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.Sync 100.00% (3/3)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.Close 100.00% (3/3)
github.com/conformal/btcdb/sqlite3/sqlitetx.go SqliteDb.FetchLocationBySha 100.00% (3/3)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.InsertBlockData 100.00% (3/3)
github.com/conformal/btcdb/sqlite3/sqlitetx.go SqliteDb.InsertTx 100.00% (3/3)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.FetchTxBufBySha 100.00% (2/2)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.InvalidateCache 100.00% (2/2)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteBlockIterator.Close 100.00% (2/2)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.FetchTxBySha 100.00% (2/2)
github.com/conformal/btcdb/sqlite3/sqlite.go OpenSqliteDB 100.00% (2/2)
github.com/conformal/btcdb/sqlite3/sqlite.go CreateSqliteDB 100.00% (2/2)
github.com/conformal/btcdb/sqlite3/sqlite.go init 100.00% (1/1)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteBlockIterator.NextRow 100.00% (1/1)
github.com/conformal/btcdb/sqlite3/sqlitetx.go SqliteDb.insertTx 96.77% (30/31)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.insertBlockCache 92.31% (12/13)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.insertTxCache 91.67% (11/12)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.FetchBlockShaByIdx 91.67% (11/12)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.rePlayTransaction 90.00% (18/20)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.NewIterateBlocks 88.24% (15/17)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.RollbackClose 87.50% (7/8)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.fetchSha 85.71% (12/14)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.ExistsSha 85.71% (6/7)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.FetchIdxRange 84.62% (22/26)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.insertBlockData 84.00% (21/25)
github.com/conformal/btcdb/sqlite3/sqlitetx.go SqliteDb.fetchLocationBySha 84.00% (21/25)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.FetchBlockBySha 83.33% (10/12)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.fetchBlockCache 83.33% (5/6)
github.com/conformal/btcdb/sqlite3/sqlitetx.go SqliteDb.FetchTxUsedBySha 82.61% (19/23)
github.com/conformal/btcdb/sqlite3/sqliteblock.go insertGenesisBlock 81.82% (9/11)
github.com/conformal/btcdb/sqlite3/sqlite.go newOrCreateSqliteDB 79.25% (42/53)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.startTx 78.57% (11/14)
github.com/conformal/btcdb/sqlite3/sqliteblock.go SqliteDb.blkExistsSha 77.78% (7/9)
github.com/conformal/btcdb/sqlite3/sqlitedbcache.go SqliteDb.FetchTxAllBySha 77.14% (27/35)
github.com/conformal/btcdb/sqlite3/sqlitetx.go SqliteDb.migrateTmpTable 76.67% (46/60)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.SetDBInsertMode 74.07% (20/27)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.syncPoint 71.43% (5/7)
github.com/conformal/btcdb/sqlite3/sqlite.go createDB 70.59% (12/17)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.DropAfterBlockBySha 68.57% (24/35)
github.com/conformal/btcdb/sqlite3/sqlite.go SqliteDb.InsertBlock 46.00% (23/50)
github.com/conformal/btcdb/sqlite3 ----------------------------- 82.15% (566/689)