Stricter test.

This commit is contained in:
Nuno Cruces
2024-08-30 09:32:30 +01:00
parent 78473b4b37
commit b9b2ff13da

View File

@@ -1,7 +1,9 @@
package tests package tests
import ( import (
"errors"
"io" "io"
"log"
"net/url" "net/url"
"os" "os"
"os/exec" "os/exec"
@@ -19,6 +21,20 @@ import (
"github.com/ncruces/go-sqlite3/vfs/memdb" "github.com/ncruces/go-sqlite3/vfs/memdb"
) )
func TestMain(m *testing.M) {
sqlite3.AutoExtension(func(c *sqlite3.Conn) error {
return c.ConfigLog(func(code sqlite3.ExtendedErrorCode, msg string) {
// Having to do journal recovery is unexpected.
if errors.Is(code, sqlite3.NOTICE) {
log.Panicf("%v (%d): %s", code, code, msg)
} else {
log.Printf("%v (%d): %s", code, code, msg)
}
})
})
m.Run()
}
func Test_parallel(t *testing.T) { func Test_parallel(t *testing.T) {
if !vfs.SupportsFileLocking { if !vfs.SupportsFileLocking {
t.Skip("skipping without locks") t.Skip("skipping without locks")