@@ -2357,25 +2357,6 @@ const (
2357
2357
okPattern = `(?m)^ok`
2358
2358
)
2359
2359
2360
- // Issue 19394
2361
- func TestWriteProfilesOnTimeout (t * testing.T ) {
2362
- tooSlow (t )
2363
- tg := testgo (t )
2364
- defer tg .cleanup ()
2365
- tg .tempDir ("profiling" )
2366
- tg .tempFile ("profiling/timeouttest_test.go" , `package timeouttest_test
2367
- import "testing"
2368
- import "time"
2369
- func TestSleep(t *testing.T) { time.Sleep(time.Second) }` )
2370
- tg .cd (tg .path ("profiling" ))
2371
- tg .runFail (
2372
- "test" ,
2373
- "-cpuprofile" , tg .path ("profiling/cpu.pprof" ), "-memprofile" , tg .path ("profiling/mem.pprof" ),
2374
- "-timeout" , "1ms" )
2375
- tg .mustHaveContent (tg .path ("profiling/cpu.pprof" ))
2376
- tg .mustHaveContent (tg .path ("profiling/mem.pprof" ))
2377
- }
2378
-
2379
2360
func TestLinkXImportPathEscape (t * testing.T ) {
2380
2361
// golang.org/issue/16710
2381
2362
skipIfGccgo (t , "gccgo does not support -ldflags -X" )
@@ -2661,29 +2642,6 @@ func TestNeedVersion(t *testing.T) {
2661
2642
tg .grepStderr ("compile" , "does not match go tool version" )
2662
2643
}
2663
2644
2664
- func TestCgoFlagContainsSpace (t * testing.T ) {
2665
- tooSlow (t )
2666
- if ! canCgo {
2667
- t .Skip ("skipping because cgo not enabled" )
2668
- }
2669
- tg := testgo (t )
2670
- defer tg .cleanup ()
2671
-
2672
- tg .makeTempdir ()
2673
- tg .cd (tg .path ("." ))
2674
- tg .tempFile ("main.go" , `package main
2675
- // #cgo CFLAGS: -I"c flags"
2676
- // #cgo LDFLAGS: -L"ld flags"
2677
- import "C"
2678
- func main() {}
2679
- ` )
2680
- tg .run ("run" , "-x" , "main.go" )
2681
- tg .grepStderr (`"-I[^"]+c flags"` , "did not find quoted c flags" )
2682
- tg .grepStderrNot (`"-I[^"]+c flags".*"-I[^"]+c flags"` , "found too many quoted c flags" )
2683
- tg .grepStderr (`"-L[^"]+ld flags"` , "did not find quoted ld flags" )
2684
- tg .grepStderrNot (`"-L[^"]+c flags".*"-L[^"]+c flags"` , "found too many quoted ld flags" )
2685
- }
2686
-
2687
2645
// Issue 9737: verify that GOARM and GO386 affect the computed build ID.
2688
2646
func TestBuildIDContainsArchModeEnv (t * testing.T ) {
2689
2647
if testing .Short () {
@@ -2783,71 +2741,6 @@ func TestBuildmodePIE(t *testing.T) {
2783
2741
}
2784
2742
}
2785
2743
2786
- func TestExecBuildX (t * testing.T ) {
2787
- tooSlow (t )
2788
- if ! canCgo {
2789
- t .Skip ("skipping because cgo not enabled" )
2790
- }
2791
-
2792
- testenv .MustHaveExecPath (t , "/usr/bin/env" )
2793
- testenv .MustHaveExecPath (t , "bash" )
2794
-
2795
- tg := testgo (t )
2796
- defer tg .cleanup ()
2797
-
2798
- tg .tempDir ("cache" )
2799
- tg .setenv ("GOCACHE" , tg .path ("cache" ))
2800
-
2801
- // Before building our test main.go, ensure that an up-to-date copy of
2802
- // runtime/cgo is present in the cache. If it isn't, the 'go build' step below
2803
- // will fail with "can't open import". See golang.org/issue/29004.
2804
- tg .run ("build" , "runtime/cgo" )
2805
-
2806
- tg .tempFile ("main.go" , `package main; import "C"; func main() { print("hello") }` )
2807
- src := tg .path ("main.go" )
2808
- obj := tg .path ("main" )
2809
- tg .run ("build" , "-x" , "-o" , obj , src )
2810
- sh := tg .path ("test.sh" )
2811
- cmds := tg .getStderr ()
2812
- err := ioutil .WriteFile (sh , []byte ("set -e\n " + cmds ), 0666 )
2813
- if err != nil {
2814
- t .Fatal (err )
2815
- }
2816
-
2817
- out , err := exec .Command (obj ).CombinedOutput ()
2818
- if err != nil {
2819
- t .Fatal (err )
2820
- }
2821
- if string (out ) != "hello" {
2822
- t .Fatalf ("got %q; want %q" , out , "hello" )
2823
- }
2824
-
2825
- err = os .Remove (obj )
2826
- if err != nil {
2827
- t .Fatal (err )
2828
- }
2829
-
2830
- out , err = exec .Command ("/usr/bin/env" , "bash" , "-x" , sh ).CombinedOutput ()
2831
- if err != nil {
2832
- t .Fatalf ("/bin/sh %s: %v\n %s" , sh , err , out )
2833
- }
2834
- t .Logf ("shell output:\n %s" , out )
2835
-
2836
- out , err = exec .Command (obj ).CombinedOutput ()
2837
- if err != nil {
2838
- t .Fatal (err )
2839
- }
2840
- if string (out ) != "hello" {
2841
- t .Fatalf ("got %q; want %q" , out , "hello" )
2842
- }
2843
-
2844
- matches := regexp .MustCompile (`^WORK=(.*)\n` ).FindStringSubmatch (cmds )
2845
- if len (matches ) == 0 {
2846
- t .Fatal ("no WORK directory" )
2847
- }
2848
- tg .must (robustio .RemoveAll (matches [1 ]))
2849
- }
2850
-
2851
2744
func TestUpxCompression (t * testing.T ) {
2852
2745
if runtime .GOOS != "linux" ||
2853
2746
(runtime .GOARCH != "amd64" && runtime .GOARCH != "386" ) {
0 commit comments