test: disable log and output to speed up testing
This commit is contained in:
@@ -17,6 +17,9 @@
|
||||
package cl_test
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/goplus/llgo/compiler/cl"
|
||||
@@ -24,6 +27,13 @@ import (
|
||||
"github.com/goplus/llgo/compiler/internal/build"
|
||||
)
|
||||
|
||||
func init() {
|
||||
devNull, _ := os.OpenFile(os.DevNull, os.O_WRONLY, 0)
|
||||
os.Stderr = devNull
|
||||
os.Stdout = devNull
|
||||
log.SetOutput(io.Discard)
|
||||
}
|
||||
|
||||
func testCompile(t *testing.T, src, expected string) {
|
||||
t.Helper()
|
||||
cltest.TestCompileEx(t, src, "foo.go", expected, false)
|
||||
|
||||
@@ -18,6 +18,9 @@ package ssa_test
|
||||
|
||||
import (
|
||||
"go/types"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/goplus/llgo/compiler/cl/cltest"
|
||||
@@ -26,6 +29,10 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
devNull, _ := os.OpenFile(os.DevNull, os.O_WRONLY, 0)
|
||||
os.Stderr = devNull
|
||||
os.Stdout = devNull
|
||||
log.SetOutput(io.Discard)
|
||||
ssa.SetDebug(ssa.DbgFlagAll)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user