github.com/gidoBOSSftw5731/go/src@v0.0.0-20210226122457-d24b0edbf019/debug/pe/file_cgo_test.go (about)

     1  // Copyright 2017 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  //go:build cgo
     6  // +build cgo
     7  
     8  package pe
     9  
    10  import (
    11  	"os/exec"
    12  	"testing"
    13  )
    14  
    15  func testCgoDWARF(t *testing.T, linktype int) {
    16  	if _, err := exec.LookPath("gcc"); err != nil {
    17  		t.Skip("skipping test: gcc is missing")
    18  	}
    19  	testDWARF(t, linktype)
    20  }
    21  
    22  func TestDefaultLinkerDWARF(t *testing.T) {
    23  	testCgoDWARF(t, linkCgoDefault)
    24  }
    25  
    26  func TestInternalLinkerDWARF(t *testing.T) {
    27  	testCgoDWARF(t, linkCgoInternal)
    28  }
    29  
    30  func TestExternalLinkerDWARF(t *testing.T) {
    31  	testCgoDWARF(t, linkCgoExternal)
    32  }