]> Cypherpunks repositories - gostls13.git/commitdiff
src/internal/godebugs: add a skip for missing godebug.md
authorMichael Matloob <matloob@golang.org>
Tue, 18 Apr 2023 16:16:43 +0000 (12:16 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 18 Apr 2023 16:58:25 +0000 (16:58 +0000)
Currently android doesn't include godebug.md in its doc folder, and
TestAll in godebugs_test.go is failing because it can't open the file.
Add a skip in case the file is missing (except for linux so we can
catch the case where we stop generating the file).

Change-Id: I37a711e49a494c33bc92bf3e31cf40471ea9d5b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/485795
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/internal/godebugs/godebugs_test.go

index 663268f02b5f39d5a257af4a502381d0036a839f..a1cb8d492a6f2215f05996d35c412b2183e48751 100644 (file)
@@ -6,7 +6,9 @@ package godebugs_test
 
 import (
        "internal/godebugs"
+       "internal/testenv"
        "os"
+       "runtime"
        "strings"
        "testing"
 )
@@ -14,6 +16,9 @@ import (
 func TestAll(t *testing.T) {
        data, err := os.ReadFile("../../../doc/godebug.md")
        if err != nil {
+               if os.IsNotExist(err) && (testenv.Builder() == "" || runtime.GOOS != "linux") {
+                       t.Skip(err)
+               }
                t.Fatal(err)
        }
        doc := string(data)