2024-04-16 17:33:48 +01:00
|
|
|
package testcfg
|
|
|
|
|
|
|
|
|
|
import (
|
2024-05-09 13:24:36 +01:00
|
|
|
"os"
|
|
|
|
|
"path/filepath"
|
|
|
|
|
|
2024-04-16 17:33:48 +01:00
|
|
|
"github.com/tetratelabs/wazero"
|
2024-10-18 12:20:32 +01:00
|
|
|
|
|
|
|
|
"github.com/ncruces/go-sqlite3"
|
2024-04-16 17:33:48 +01:00
|
|
|
)
|
|
|
|
|
|
2024-07-20 01:42:50 +01:00
|
|
|
// notest
|
|
|
|
|
|
2024-04-16 17:33:48 +01:00
|
|
|
func init() {
|
2025-02-18 16:36:22 +00:00
|
|
|
sqlite3.RuntimeConfig = wazero.NewRuntimeConfig().WithMemoryLimitPages(512)
|
2024-05-09 13:24:36 +01:00
|
|
|
if os.Getenv("CI") != "" {
|
|
|
|
|
path := filepath.Join(os.TempDir(), "wazero")
|
|
|
|
|
if err := os.MkdirAll(path, 0777); err == nil {
|
|
|
|
|
if cache, err := wazero.NewCompilationCacheWithDir(path); err == nil {
|
2024-11-05 17:30:10 +00:00
|
|
|
sqlite3.RuntimeConfig = sqlite3.RuntimeConfig.
|
|
|
|
|
WithCompilationCache(cache)
|
2024-05-09 13:24:36 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-16 17:33:48 +01:00
|
|
|
}
|