test(build):collect llgo test ./... output to test

This commit is contained in:
luoliwoshang
2025-06-25 14:46:44 +08:00
parent 3df783de13
commit 6e8f3d1d19
12 changed files with 62 additions and 22 deletions

View File

@@ -0,0 +1,5 @@
package bar
func Bar() int {
return 2
}

View File

@@ -0,0 +1,13 @@
package bar_test
import (
"testing"
"github.com/goplus/llgo/cl/_testgo/runextest/bar"
)
func TestBar(t *testing.T) {
if bar.Bar() != 2 {
t.Fatal("Bar() != 2")
}
}

View File

@@ -0,0 +1,5 @@
package barinner
func BarInner() int {
return 2
}

View File

@@ -0,0 +1,13 @@
package barinner_test
import (
"testing"
"github.com/goplus/llgo/cl/_testgo/runextest/bar/barinner"
)
func TestBarInner(t *testing.T) {
if barinner.BarInner() != 2 {
t.Fatal("BarInner() != 2")
}
}

View File

@@ -0,0 +1,5 @@
package foo
func Foo() int {
return 1
}

View File

@@ -0,0 +1,13 @@
package foo_test
import (
"testing"
"github.com/goplus/llgo/cl/_testgo/runextest/foo"
)
func TestFoo(t *testing.T) {
if foo.Foo() != 1 {
t.Fatal("Foo() != 1")
}
}

View File

@@ -0,0 +1,16 @@
package main
import (
"github.com/goplus/llgo/cl/_testgo/runextest/bar"
"github.com/goplus/llgo/cl/_testgo/runextest/foo"
)
func Zoo() int {
return 3
}
func main() {
println("foo.Foo()", foo.Foo())
println("bar.Bar()", bar.Bar())
println("Zoo()", Zoo())
}

View File

@@ -0,0 +1,11 @@
package main
import (
"testing"
)
func TestZoo(t *testing.T) {
if Zoo() != 3 {
t.Fatal("Zoo() != 3")
}
}

View File

@@ -0,0 +1 @@
;