-
Notifications
You must be signed in to change notification settings - Fork 0
/
cgo_test.go
40 lines (31 loc) · 859 Bytes
/
cgo_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2017 The Sqlite Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ignore || (cgo && cgotest)
// +build ignore cgo,cgotest
package sqlite // import "modernc.org/sqlite"
import (
"database/sql"
"os"
"path/filepath"
"testing"
_ "github.com/mattn/go-sqlite3"
)
// https://gitlab.com/cznic/sqlite/-/issues/65
func TestIssue65CGo(t *testing.T) {
tempDir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatal(err)
}
defer func() {
os.RemoveAll(tempDir)
}()
db, err := sql.Open("sqlite3", filepath.Join(tempDir, "testissue65.sqlite"))
if err != nil {
t.Fatalf("Failed to open database: %v", err)
}
testIssue65(t, db, false)
}
func BenchmarkConcurrentCGo(b *testing.B) {
benchmarkConcurrent(b, "sqlite3", []string{"sql", "drv"})
}