1 | // Copyright 2020 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 framepointer_test |
6 | |
7 | import ( |
8 | "go/build" |
9 | "testing" |
10 | |
11 | "golang.org/x/tools/go/analysis/analysistest" |
12 | "golang.org/x/tools/go/analysis/passes/framepointer" |
13 | ) |
14 | |
15 | func Test(t *testing.T) { |
16 | if build.Default.GOOS != "linux" && build.Default.GOOS != "darwin" { |
17 | // The test has an os-generic assembly file, testdata/a/asm_amd64.s. |
18 | // It should produce errors on linux or darwin, but not on other archs. |
19 | // Unfortunately, there's no way to say that in the "want" comments |
20 | // in that file. So we skip testing on other GOOSes. The framepointer |
21 | // analyzer should not report any errors on those GOOSes, so it's not |
22 | // really a hard test on those platforms. |
23 | t.Skipf("test for GOOS=%s is not implemented", build.Default.GOOS) |
24 | } |
25 | analysistest.Run(t, analysistest.TestData(), framepointer.Analyzer, "a") |
26 | } |
27 |