diff options
| author | Bryan C. Mills <bcmills@google.com> | 2021-12-06 17:25:34 -0500 |
|---|---|---|
| committer | Bryan Mills <bcmills@google.com> | 2021-12-07 03:44:02 +0000 |
| commit | dc65c489cc5a795a68d844ed7a45e5d16562401d (patch) | |
| tree | 5a40e310ca0cc69a91e66971187ddd87778c353a /src | |
| parent | e07b02ff87af594a68484dcb1e3a78d1c39abc56 (diff) | |
| download | go-dc65c489cc5a795a68d844ed7a45e5d16562401d.tar.xz | |
cmd/go: fix tests broken in CL 358539
CL 358539 revised the build-stamp format, and updated the git and hg
tests to match. However, the fossil and bzr tests were missed, and
were not caught on the builders due to the fact that none of the
builder images have the necessary VCS tools installed.
Updates #48802
Updates #49168
Change-Id: I6b9fd0e19b81cb539864c94ab0860f74e7be6748
Reviewed-on: https://go-review.googlesource.com/c/go/+/369743
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/testdata/script/version_buildvcs_bzr.txt | 33 | ||||
| -rw-r--r-- | src/cmd/go/testdata/script/version_buildvcs_fossil.txt | 21 |
2 files changed, 30 insertions, 24 deletions
diff --git a/src/cmd/go/testdata/script/version_buildvcs_bzr.txt b/src/cmd/go/testdata/script/version_buildvcs_bzr.txt index 83069713d7..85db9bab6d 100644 --- a/src/cmd/go/testdata/script/version_buildvcs_bzr.txt +++ b/src/cmd/go/testdata/script/version_buildvcs_bzr.txt @@ -31,14 +31,15 @@ cd .. env PATH=$oldpath rm .bzr -# If there is an empty repository in a parent directory, only "uncommitted" is tagged. +# If there is an empty repository in a parent directory, only "modified" is tagged. exec bzr init cd a go install go version -m $GOBIN/a$GOEXE -! stdout bzrrevision -! stdout bzrcommittime -stdout '^\tbuild\tbzruncommitted\ttrue$' +stdout '^\tbuild\tvcs=bzr$' +! stdout vcs.revision +! stdout vcs.time +stdout '^\tbuild\tvcs.modified=true$' cd .. # Revision and commit time are tagged for repositories with commits. @@ -47,9 +48,10 @@ exec bzr commit -m 'initial commit' cd a go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tbzrrevision\t' -stdout '^\tbuild\tbzrcommittime\t' -stdout '^\tbuild\tbzruncommitted\tfalse$' +stdout '^\tbuild\tvcs=bzr$' +stdout '^\tbuild\tvcs.revision=' +stdout '^\tbuild\tvcs.time=' +stdout '^\tbuild\tvcs.modified=false$' rm $GOBIN/a$GOEXE # Building an earlier commit should still build clean. @@ -59,29 +61,30 @@ exec bzr commit -m 'add NEWS' exec bzr update -r1 go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tbzrrevision\t' -stdout '^\tbuild\tbzrcommittime\t' -stdout '^\tbuild\tbzruncommitted\tfalse$' +stdout '^\tbuild\tvcs=bzr$' +stdout '^\tbuild\tvcs.revision=' +stdout '^\tbuild\tvcs.time=' +stdout '^\tbuild\tvcs.modified=false$' # Building with -buildvcs=false suppresses the info. go install -buildvcs=false go version -m $GOBIN/a$GOEXE -! stdout bzrrevision +! stdout vcs.revision rm $GOBIN/a$GOEXE -# An untracked file is shown as uncommitted, even if it isn't part of the build. +# An untracked file is shown as modified, even if it isn't part of the build. cp ../../outside/empty.txt . go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tbzruncommitted\ttrue$' +stdout '^\tbuild\tvcs.modified=true$' rm empty.txt rm $GOBIN/a$GOEXE -# An edited file is shown as uncommitted, even if it isn't part of the build. +# An edited file is shown as modified, even if it isn't part of the build. cp ../../outside/empty.txt ../README go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tbzruncommitted\ttrue$' +stdout '^\tbuild\tvcs.modified=true$' exec bzr revert ../README rm $GOBIN/a$GOEXE diff --git a/src/cmd/go/testdata/script/version_buildvcs_fossil.txt b/src/cmd/go/testdata/script/version_buildvcs_fossil.txt index 3a4bde883f..720306868b 100644 --- a/src/cmd/go/testdata/script/version_buildvcs_fossil.txt +++ b/src/cmd/go/testdata/script/version_buildvcs_fossil.txt @@ -19,7 +19,7 @@ cd repo/a # If there's no local repository, there's no VCS info. go install go version -m $GOBIN/a$GOEXE -! stdout fossilrevision +! stdout vcs.revision rm $GOBIN/a$GOEXE # If there is a repository, but it can't be used for some reason, @@ -44,30 +44,33 @@ exec fossil commit -m 'initial commit' cd a go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tfossilrevision\t' -stdout '^\tbuild\tfossilcommittime\t' -stdout '^\tbuild\tfossiluncommitted\tfalse$' +stdout '^\tbuild\tvcs=fossil\n' +stdout '^\tbuild\tvcs.revision=' +stdout '^\tbuild\tvcs.time=' +stdout '^\tbuild\tvcs.modified=false$' rm $GOBIN/a$GOEXE # Building with -buildvcs=false suppresses the info. go install -buildvcs=false go version -m $GOBIN/a$GOEXE -! stdout fossilrevision +! stdout vcs.revision rm $GOBIN/a$GOEXE -# An untracked file is shown as uncommitted, even if it isn't part of the build. +# An untracked file is shown as modified, even if it isn't part of the build. cp ../../outside/empty.txt . go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tfossiluncommitted\ttrue$' +stdout '^\tbuild\tvcs=fossil\n' +stdout '^\tbuild\tvcs.modified=true$' rm empty.txt rm $GOBIN/a$GOEXE -# An edited file is shown as uncommitted, even if it isn't part of the build. +# An edited file is shown as modified, even if it isn't part of the build. cp ../../outside/empty.txt ../README go install go version -m $GOBIN/a$GOEXE -stdout '^\tbuild\tfossiluncommitted\ttrue$' +stdout '^\tbuild\tvcs=fossil\n' +stdout '^\tbuild\tvcs.modified=true$' exec fossil revert ../README rm $GOBIN/a$GOEXE |
