e2e_test.go 631 B

12345678910111213141516171819202122232425262728293031323334
  1. package e2e
  2. import (
  3. "flag"
  4. "fmt"
  5. "os"
  6. "testing"
  7. "github.com/fatedier/frp/test/e2e/framework"
  8. "github.com/fatedier/frp/utils/log"
  9. )
  10. // handleFlags sets up all flags and parses the command line.
  11. func handleFlags() {
  12. framework.RegisterCommonFlags(flag.CommandLine)
  13. flag.Parse()
  14. }
  15. func TestMain(m *testing.M) {
  16. // Register test flags, then parse flags.
  17. handleFlags()
  18. if err := framework.ValidateTestContext(&framework.TestContext); err != nil {
  19. fmt.Println(err)
  20. os.Exit(1)
  21. }
  22. log.InitLog("console", "", framework.TestContext.LogLevel, 0, true)
  23. os.Exit(m.Run())
  24. }
  25. func TestE2E(t *testing.T) {
  26. RunE2ETests(t)
  27. }