| 1 | package e2e |
| 2 | |
| 3 | import ( |
| 4 | "flag" |
| 5 | "fmt" |
| 6 | "os" |
| 7 | "testing" |
| 8 | |
| 9 | _ "github.com/onsi/ginkgo/v2" |
| 10 | |
| 11 | "github.com/fatedier/frp/pkg/util/log" |
| 12 | // test source |
| 13 | "github.com/fatedier/frp/test/e2e/framework" |
| 14 | _ "github.com/fatedier/frp/test/e2e/legacy/basic" |
| 15 | _ "github.com/fatedier/frp/test/e2e/legacy/features" |
| 16 | _ "github.com/fatedier/frp/test/e2e/legacy/plugin" |
| 17 | _ "github.com/fatedier/frp/test/e2e/v1/basic" |
| 18 | _ "github.com/fatedier/frp/test/e2e/v1/features" |
| 19 | _ "github.com/fatedier/frp/test/e2e/v1/plugin" |
| 20 | ) |
| 21 | |
| 22 | // handleFlags sets up all flags and parses the command line. |
| 23 | func handleFlags() { |
| 24 | framework.RegisterCommonFlags(flag.CommandLine) |
| 25 | flag.Parse() |
| 26 | } |
| 27 | |
| 28 | func TestMain(m *testing.M) { |
| 29 | // Register test flags, then parse flags. |
| 30 | handleFlags() |
| 31 | |
| 32 | if err := framework.ValidateTestContext(&framework.TestContext); err != nil { |
| 33 | fmt.Println(err) |
| 34 | os.Exit(1) |
| 35 | } |
| 36 | |
| 37 | log.InitLogger("console", framework.TestContext.LogLevel, 0, true) |
| 38 | os.Exit(m.Run()) |
| 39 | } |
| 40 | |
| 41 | func TestE2E(t *testing.T) { |
| 42 | RunE2ETests(t) |
| 43 | } |