github.com/aloncn/graphics-go@v0.0.1/src/runtime/race/testdata/cgo_test.go (about)

     1  // Copyright 2012 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 race_test
     6  
     7  import (
     8  	"os"
     9  	"os/exec"
    10  	"testing"
    11  )
    12  
    13  func TestNoRaceCgoSync(t *testing.T) {
    14  	cmd := exec.Command("go", "run", "-race", "cgo_test_main.go")
    15  	cmd.Stdout = os.Stdout
    16  	cmd.Stderr = os.Stderr
    17  	if err := cmd.Run(); err != nil {
    18  		t.Fatalf("program exited with error: %v\n", err)
    19  	}
    20  }