...

Source file src/github.com/linkerd/linkerd2/cli/cmd/main_test.go

Documentation: github.com/linkerd/linkerd2/cli/cmd

     1  package cmd
     2  
     3  import (
     4  	"flag"
     5  	"os"
     6  	"testing"
     7  
     8  	"github.com/linkerd/linkerd2/testutil"
     9  )
    10  
    11  var (
    12  	testDataDiffer testutil.TestDataDiffer
    13  )
    14  
    15  // TestMain parses flags before running tests
    16  func TestMain(m *testing.M) {
    17  	flag.BoolVar(&testDataDiffer.UpdateFixtures, "update", false, "update text fixtures in place")
    18  	prettyDiff := os.Getenv("LINKERD_TEST_PRETTY_DIFF") != ""
    19  	flag.BoolVar(&testDataDiffer.PrettyDiff, "pretty-diff", prettyDiff, "display the full text when diffing")
    20  	flag.StringVar(&testDataDiffer.RejectPath, "reject-path", "", "write results for failed tests to this path (path is relative to the test location)")
    21  	flag.Parse()
    22  	os.Exit(m.Run())
    23  }
    24  

View as plain text