| // Copyright 2014 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| f, err := ioutil.TempFile("", "sinit-*.o") |
| cmd := exec.Command("go", "tool", "compile", "-p=sinit", "-o", f.Name(), "-S", "sinit.go") |
| out, err := cmd.CombinedOutput() |
| if len(bytes.TrimSpace(out)) == 0 { |
| fmt.Println("'go tool compile -S sinit.go' printed no output") |
| if bytes.Contains(out, []byte("initdone")) { |
| fmt.Println("sinit generated an init function") |