aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api/api_test.go
AgeCommit message (Collapse)Author
2023-08-17[release-branch.go1.21] cmd/api: rename api.go to main_test.goRuss Cox
This makes cmd/api no longer an importable package. In CL 453258 I forgot that there was no direct prohibition on importing packages from cmd - we just rely on the fact that cmd/* is all package main and everything else is cmd/internal. Fixes #62069. Fixes #62071. Change-Id: Ifed738d333b40663f85eca8f83025fcea5df89a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/520038 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/520061
2023-06-15cmd/api: skip TestIssue29837 when -short is setqmuntal
TestIssue29837 takes a long time to run, ~150s on my laptop and ~40s on CI builders. While here, warm up the go list cache in parallel, which reduces the test time by ~10%. Change-Id: Ib8d45b086453ee03e6c9f3f070d6f6b0d324bfd4 Reviewed-on: https://go-review.googlesource.com/c/go/+/502095 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2023-05-19cmd/api: skip TestIssue21181Russ Cox
It is incredibly slow, taking half as long as the regular cmd/api checks and over 5 minutes on plan9-arm. Leave it for the longtest builders. Change-Id: Ic8bd420f174268d0b6a13d84e7bd364f6c13cf41 Reviewed-on: https://go-review.googlesource.com/c/go/+/496375 Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2023-05-03cmd/api: move support checks into individual testsBryan C. Mills
This makes 'go test -list cmd/api' work, and fixes an infinite recursion via testenv.HasExec that would otherwise occur. As of CL 488076, testenv.HasExec tries to re-exec the test executable using -list to suppress running the tests, which produces a fork bomb if TestMain itself calls HasExec. For this test, it turns out that the HasExec check is redundant anyway: if we can exec 'go build', we can certainly exec programs in general too. Change-Id: I165f98315c181098c8be8b7525b9dfa3f98e14f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/491656 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
2023-04-27cmd/api: remove unused functionalityDmitri Shuralyov
We no longer use the optional parameter to compareAPI. We now always set allowAdd to false. (Except in tests, making them less useful than they could be.) Flags and parsing their value are no more. Remove all the unused functionality and update test cases so they're closer to what the API checker does when it runs for real. Order the features, required, exception variables and fields more consistently. For #43956. Change-Id: Iaa4656a89a3fca3129742165a448d385e55e4a98 Reviewed-on: https://go-review.googlesource.com/c/go/+/489436 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-12-02cmd/api: track deprecationsRuss Cox
Deprecating an API creates notices that go out to potentially millions of Go developers encouraging them to update their code. The choice to deprecate an API is as important as the choice to add a new API. We should track those and make them explicit. This will also ensure that deprecations go through proposal review. Change-Id: Ide9f60c32e5a88fb133e0dfedd984b8b0f70f510 Reviewed-on: https://go-review.googlesource.com/c/go/+/453259 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-11-28cmd/api: rewrite as package testRuss Cox
No one ever runs 'go tool api', because the invocation has gotten unwieldy enough that it's not practical. And we don't support it as a standalone tool for other packages - it's not even in the distribution. Making it an ordinary package test lets us invoke it more easily from cmd/dist (as go test cmd/api -check) and avoids the increasingly baroque code in run.go to build a command line. Left in cmd/api even though it's no longer a command because (1) it uses a package from cmd/vendor and (2) it uses internal/testenv. Otherwise it could be misc/api. Fixes #56845. Change-Id: I00a13d9c19b1e259fa0e6bb93d1a4dca25f0e8c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/453258 Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Russ Cox <rsc@golang.org>