all_test/TestThread{1,4}: Run more than once.

modified:   Makefile
	modified:   all_test.go
This commit is contained in:
Jan Mercl
2017-07-03 14:43:34 +02:00
parent 4e3524142c
commit 51c2f03f63
2 changed files with 43 additions and 39 deletions

View File

@@ -20,7 +20,7 @@ all: editor
clean:
go clean
rm -f *~ *.test *.out
rm -f *~ *.test *.out test.db testdb-* tt4-test*.db
cover:
t=$(shell tempfile) ; go test -coverprofile $$t && go tool cover -html $$t && unlink $$t

View File

@@ -404,6 +404,7 @@ func TestMP(t *testing.T) {
}
func TestThread1(t *testing.T) {
for i := 0; i < 10; i++ {
dir, err := ioutil.TempDir("", "sqlite-test-")
if err != nil {
t.Fatal(err)
@@ -434,14 +435,15 @@ func TestThread1(t *testing.T) {
t.Fatalf("go build mptest: %s\n%s", err, out)
}
for i := 1; i <= 10; i++ {
out, err := exec.Command("./threadtest1", strconv.Itoa(i), "-v").CombinedOutput()
t.Logf("%v: %s", i, out)
for j := 0; j <= 20; j++ {
out, err := exec.Command("./threadtest1", strconv.Itoa(j), "-v").CombinedOutput()
t.Logf("%v, %v: %s", i, j, out)
if err != nil {
t.Fatal(err)
}
}
}
}
func TestThread2(t *testing.T) {
dir, err := ioutil.TempDir("", "sqlite-test-")
@@ -514,15 +516,17 @@ func TestThread4(t *testing.T) {
for _, opts := range [][]string{
{},
{"-serialized", "-wal"},
{"-serialized"},
{"-multithread"},
{"-multithread", "-wal"},
{"-wal"},
{"-serialized"},
{"-serialized", "-wal"},
{"--multithread"},
{"--multithread", "-wal"},
{"--multithread", "-serialized"},
{"--multithread", "-serialized", "-wal"},
} {
for i := 2; i <= 10; i++ {
out, err := exec.Command("./threadtest4", append(opts, strconv.Itoa(i))...).CombinedOutput()
t.Logf("%v: %s", i, out)
t.Logf("%v: %v %s", i, opts, out)
if err != nil {
t.Fatal(err)
}