Commit b406626c authored by cznic's avatar cznic

release v1.4.0-beta1

parent d8d9f40c
......@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
.PHONY: all clean cover cpu editor internalError later mem nuke todo edit
.PHONY: all clean cover cpu editor internalError later mem nuke todo edit tcl
grep=--include=*.go --include=*.l --include=*.y --include=*.yy
ngrep='TODOOK\|internal\/bin'
ngrep='TODOOK\|internal\/vfs\|internal\/bin\|internal\/mptest\|.*stringer.*\.go'
all: editor
date
......@@ -16,7 +16,7 @@ all: editor
go test 2>&1 -timeout 1h | tee -a log
#TODO GOOS=linux GOARCH=arm go build
#TODO GOOS=linux GOARCH=arm64 go build
GOOS=linux GOARCH=386 go build
#TODO GOOS=linux GOARCH=386 go build
GOOS=linux GOARCH=amd64 go build
#TODO GOOS=windows GOARCH=386 go build
#TODO GOOS=windows GOARCH=amd64 go build
......@@ -26,6 +26,7 @@ all: editor
misspell *.go
staticcheck | grep -v 'lexer\.go\|parser\.go' || true
maligned || true
git diff --unified=0 testdata *.golden
grep -n 'FAIL\|PASS' log
go version
date 2>&1 | tee -a log
......@@ -67,3 +68,17 @@ todo:
@grep -nr $(grep) TODO * | grep -v $(ngrep) || true
@grep -nr $(grep) BUG * | grep -v $(ngrep) || true
@grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true
tcl:
cp log log-0
go test -run Tcl$$ 2>&1 -timeout 24h -trc | tee log
grep -c '\.\.\. \?Ok' log || true
grep -c '^!' log || true
# grep -c 'Error:' log || true
tclshort:
cp log log-0
go test -run Tcl$$ -short 2>&1 -timeout 24h -trc | tee log
grep -c '\.\.\. \?Ok' log || true
grep -c '^!' log || true
# grep -c 'Error:' log || true
......@@ -26,6 +26,8 @@ import (
"time"
"modernc.org/mathutil"
"modernc.org/sqlite/internal/testfixture"
"modernc.org/tcl"
)
func caller(s string, va ...interface{}) {
......@@ -80,15 +82,28 @@ func stack() string { return string(debug.Stack()) }
func use(...interface{}) {}
func init() {
use(caller, dbg, TODO, trace) //TODOOK
use(caller, dbg, TODO, trace, stack) //TODOOK
}
// ============================================================================
var (
oMaxError = flag.Uint("maxerror", 0, "argument of -maxerror passed to the Tcl test suite")
oStart = flag.String("start", "", "argument of -start passed to the Tcl test suite (--start=[$permutation:]$testfile)")
oVerbose = flag.String("verbose", "0", "argument of -verbose passed to the Tcl test suite, must be set to a boolean (0, 1) or to \"file\"")
recsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
)
func TestMain(m *testing.M) {
oTestFixture := flag.Bool("testfixture", false, "emulate running the testfixture binary produced by sqlite3 '$ make tcltest'")
flag.Parse()
if !*oTestFixture {
os.Exit(m.Run())
}
tclTestMain()
}
func tempDB(t testing.TB) (string, *sql.DB) {
dir, err := ioutil.TempDir("", "sqlite-test-")
if err != nil {
......@@ -296,7 +311,7 @@ func BenchmarkNextMemory(b *testing.B) {
r, err := db.Query("select * from t")
if err != nil {
b.Fatal(err)
}
defer r.Close()
......@@ -416,11 +431,11 @@ func TestConcurrentGoroutines(t *testing.T) {
lim := ngoroutines * nrows
rng, err := mathutil.NewFC32(0, lim-1, false)
if err != nil {
t.Fatal(err)
panic(fmt.Errorf("internal error: %v", err))
}
for i := 0; i < lim; i++ {
rnd <- int(rng.Next())
rnd <- rng.Next()
}
}()
......@@ -770,3 +785,185 @@ func TestNoRows(t *testing.T) {
t.Fatal(err)
}
}
// 630 errors out of 200177 tests on Linux 64-bit little-endian
func TestTclTest(t *testing.T) {
blacklist := []string{
//TODO crashers
"exists.test",
"index.test",
// "mallocK.test",
"misc1.test",
"quota2.test",
// "sortfault.test",
// "swarmvtabfault.test",
"multiplex2.test",
"symlink.test",
"pager1.test",
"printf.test",
// "walfault.test",
// "walfault2.test",
// "walhook.test",
// "walmode.test",
// "walnoshm.test",