e2e_test.go 769 B

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