aboutsummaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2022-09-21 15:51:27 -0400
committerMichael Matloob <matloob@golang.org>2022-10-12 23:16:41 +0000
commit6f445a9db55f65e55c5be29d3c506ecf3be37915 (patch)
treeab724d4e441708257a4a5cf4141964c6b63238bf /test/fixedbugs
parent0ae042f977942a60d7955bc10bf654835e47e12a (diff)
downloadgo-6f445a9db55f65e55c5be29d3c506ecf3be37915.tar.xz
test: update test/run.go and some tests to use importcfg
Using importcfg instead of depending on the existence of .a files for standard library packages will enable us to remove the .a files in a future cl. Change-Id: I6108384224508bc37d82fd990fc4a8649222502c Reviewed-on: https://go-review.googlesource.com/c/go/+/440222 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/bug369.go13
-rw-r--r--test/fixedbugs/issue21317.go2
2 files changed, 10 insertions, 5 deletions
diff --git a/test/fixedbugs/bug369.go b/test/fixedbugs/bug369.go
index 5bababd63e..65dd9adc73 100644
--- a/test/fixedbugs/bug369.go
+++ b/test/fixedbugs/bug369.go
@@ -31,10 +31,15 @@ func main() {
check(os.Mkdir(tmp("test"), 0777))
- run("go", "tool", "compile", "-p=test/slow", "-N", "-o", tmp("test/slow.o"), "pkg.go")
- run("go", "tool", "compile", "-p=test/fast", "-o", tmp("test/fast.o"), "pkg.go")
- run("go", "tool", "compile", "-p=main", "-D", "test", "-I", tmpDir, "-o", tmp("main.o"), "main.go")
- run("go", "tool", "link", "-L", tmpDir, "-o", tmp("a.exe"), tmp("main.o"))
+ stdlibimportcfg, err := os.ReadFile(os.Getenv("STDLIB_IMPORTCFG"))
+ check(err)
+ importcfg := string(stdlibimportcfg) + "\npackagefile test/slow=" + tmp("test/slow.o") + "\npackagefile test/fast=" + tmp("test/fast.o")
+ os.WriteFile(tmp("importcfg"), []byte(importcfg), 0644)
+
+ run("go", "tool", "compile", "-importcfg="+tmp("importcfg"), "-p=test/slow", "-N", "-o", tmp("test/slow.o"), "pkg.go")
+ run("go", "tool", "compile", "-importcfg="+tmp("importcfg"), "-p=test/fast", "-o", tmp("test/fast.o"), "pkg.go")
+ run("go", "tool", "compile", "-importcfg="+tmp("importcfg"), "-p=main", "-D", "test", "-o", tmp("main.o"), "main.go")
+ run("go", "tool", "link", "-importcfg="+tmp("importcfg"), "-o", tmp("a.exe"), tmp("main.o"))
run(tmp("a.exe"))
}
diff --git a/test/fixedbugs/issue21317.go b/test/fixedbugs/issue21317.go
index 80797f73ed..81379dcc33 100644
--- a/test/fixedbugs/issue21317.go
+++ b/test/fixedbugs/issue21317.go
@@ -38,7 +38,7 @@ func main() {
defer os.RemoveAll(f.Name())
// compile and test output
- cmd := exec.Command("go", "tool", "compile", "-p=main", f.Name())
+ cmd := exec.Command("go", "tool", "compile", "-p=main", "-importcfg="+os.Getenv("STDLIB_IMPORTCFG"), f.Name())
out, err := cmd.CombinedOutput()
if err == nil {
log.Fatalf("expected cmd/compile to fail")