Text file src/cmd/go/testdata/script/build_darwin_dsym.txt

     1  [!GOOS:darwin] skip
     2  [short] skip
     3  
     4  # go build should emit executable and .dSYM directory.
     5  go build -ldflags=-splitdwarf
     6  exists m
     7  exists m.dSYM/Contents/Resources/DWARF/m
     8  
     9  # go build -o should use the target executable name for .dSYM.
    10  go build -o sub/x -ldflags=-splitdwarf
    11  exists sub/x
    12  exists sub/x.dSYM/Contents/Resources/DWARF/x
    13  
    14  # Cached no-op rebuild should keep the existing .dSYM directory.
    15  go build -ldflags=-splitdwarf
    16  exists m
    17  exists m.dSYM/Contents/Resources/DWARF/m
    18  
    19  # Rebuilding with -ldflags=-splitdwarf=0 should remove the existing .dSYM directory.
    20  go build -ldflags=-splitdwarf=0
    21  exists m
    22  ! exists m.dSYM
    23  
    24  # Rebuilding with -ldflags=-splitdwarf should recreate the .dSYM directory.
    25  go build -ldflags=-splitdwarf
    26  exists m
    27  exists m.dSYM/Contents/Resources/DWARF/m
    28  
    29  # Rebuilding with -ldflags=-w should remove the existing .dSYM directory.
    30  go build -ldflags=-w
    31  exists m
    32  ! exists m.dSYM
    33  
    34  # go test -c should emit test executable and .dSYM directory.
    35  go test -c -ldflags=-splitdwarf
    36  exists m.test
    37  exists m.test.dSYM/Contents/Resources/DWARF/m.test
    38  
    39  go test -c -o sub/t.test -ldflags=-w
    40  exists sub/t.test
    41  ! exists sub/t.test.dSYM
    42  
    43  # go install should not install the .dSYM directory.
    44  env GOBIN=$WORK/bin
    45  go install -ldflags=-splitdwarf .
    46  exists $GOBIN/m
    47  ! exists $GOBIN/m.dSYM
    48  
    49  # go clean should remove executables and .dSYM directories.
    50  go clean
    51  ! exists m
    52  ! exists m.dSYM
    53  ! exists m.test
    54  ! exists m.test.dSYM
    55  
    56  -- go.mod --
    57  module m
    58  
    59  go 1.21
    60  -- main.go --
    61  package main
    62  
    63  func main() {}
    64  -- main_test.go --
    65  package main
    66  
    67  import "testing"
    68  
    69  func TestMain(t *testing.T) {}
    70  

View as plain text