Source file src/cmd/internal/fuzztest/script_test.go

     1  // Copyright 2025 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package fuzztest
     6  
     7  import (
     8  	"cmd/internal/script/scripttest"
     9  	"flag"
    10  	"internal/testenv"
    11  	"runtime"
    12  	"testing"
    13  )
    14  
    15  //go:generate go test cmd/internal/fuzztest -v -run=TestScript/README --fixreadme
    16  
    17  var fixReadme = flag.Bool("fixreadme", false, "if true, update README for script tests")
    18  
    19  func TestScript(t *testing.T) {
    20  	testenv.MustHaveGoBuild(t)
    21  	testenv.SkipIfShortAndSlow(t)
    22  	if runtime.GOARCH == "386" && runtime.GOMAXPROCS(0) > 2 {
    23  		// # 65434: limit GOMAXPROCS for 386 to avoid running out of address space.
    24  		t.Setenv("GOMAXPROCS", "2")
    25  	}
    26  	scripttest.RunToolScriptTest(t, nil, "testdata/script", *fixReadme)
    27  }
    28  

View as plain text