2014-12-08 11:28:18 -07:00
|
|
|
// +build !nacl
|
|
|
|
// run
|
2012-09-23 11:16:14 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-08-10 18:39:38 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2014-12-08 11:28:18 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"path/filepath"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2015-05-21 11:28:13 -06:00
|
|
|
run("go", "tool", "compile", filepath.Join("fixedbugs", "bug302.dir", "p.go"))
|
2015-05-21 11:28:17 -06:00
|
|
|
run("go", "tool", "pack", "grc", "pp.a", "p.o")
|
2015-05-21 11:28:13 -06:00
|
|
|
run("go", "tool", "compile", "-I", ".", filepath.Join("fixedbugs", "bug302.dir", "main.go"))
|
2015-05-21 11:28:17 -06:00
|
|
|
os.Remove("p.o")
|
2014-12-08 11:28:18 -07:00
|
|
|
os.Remove("pp.a")
|
2015-05-21 11:28:17 -06:00
|
|
|
os.Remove("main.o")
|
2014-12-08 11:28:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func run(cmd string, args ...string) {
|
|
|
|
out, err := exec.Command(cmd, args...).CombinedOutput()
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(string(out))
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|