Skip to content

Commit 020b89b

Browse files
committed
ytest: GopTestClass
1 parent 0fb0728 commit 020b89b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ytest/classfile.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"net/http"
2222
"net/http/httptest"
2323
"os"
24+
"reflect"
2425
"strings"
2526
"testing"
2627

@@ -31,7 +32,8 @@ import (
3132
)
3233

3334
const (
34-
GopPackage = "github.com/goplus/yap/test"
35+
GopPackage = "github.com/goplus/yap/test"
36+
GopTestClass = true
3537
)
3638

3739
// -----------------------------------------------------------------------------
@@ -100,6 +102,7 @@ func Gopt_App_Main(app interface{ initApp() *App }, workers ...interface{ initCa
100102
t := logt.New()
101103
for _, worker := range workers {
102104
worker.initCase(a, t)
105+
reflect.ValueOf(worker).Elem().Field(1).Set(reflect.ValueOf(app)) // (*worker).App = app
103106
worker.(interface{ Main() }).Main()
104107
}
105108
}

ytest/demo/match/hello/gop_autogen.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)