Skip to content

Commit dc65c48

Browse files
author
Bryan C. Mills
committed
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>
1 parent e07b02f commit dc65c48

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

src/cmd/go/testdata/script/version_buildvcs_bzr.txt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@ cd ..
3131
env PATH=$oldpath
3232
rm .bzr
3333

34-
# If there is an empty repository in a parent directory, only "uncommitted" is tagged.
34+
# If there is an empty repository in a parent directory, only "modified" is tagged.
3535
exec bzr init
3636
cd a
3737
go install
3838
go version -m $GOBIN/a$GOEXE
39-
! stdout bzrrevision
40-
! stdout bzrcommittime
41-
stdout '^\tbuild\tbzruncommitted\ttrue$'
39+
stdout '^\tbuild\tvcs=bzr$'
40+
! stdout vcs.revision
41+
! stdout vcs.time
42+
stdout '^\tbuild\tvcs.modified=true$'
4243
cd ..
4344

4445
# Revision and commit time are tagged for repositories with commits.
@@ -47,9 +48,10 @@ exec bzr commit -m 'initial commit'
4748
cd a
4849
go install
4950
go version -m $GOBIN/a$GOEXE
50-
stdout '^\tbuild\tbzrrevision\t'
51-
stdout '^\tbuild\tbzrcommittime\t'
52-
stdout '^\tbuild\tbzruncommitted\tfalse$'
51+
stdout '^\tbuild\tvcs=bzr$'
52+
stdout '^\tbuild\tvcs.revision='
53+
stdout '^\tbuild\tvcs.time='
54+
stdout '^\tbuild\tvcs.modified=false$'
5355
rm $GOBIN/a$GOEXE
5456

5557
# Building an earlier commit should still build clean.
@@ -59,29 +61,30 @@ exec bzr commit -m 'add NEWS'
5961
exec bzr update -r1
6062
go install
6163
go version -m $GOBIN/a$GOEXE
62-
stdout '^\tbuild\tbzrrevision\t'
63-
stdout '^\tbuild\tbzrcommittime\t'
64-
stdout '^\tbuild\tbzruncommitted\tfalse$'
64+
stdout '^\tbuild\tvcs=bzr$'
65+
stdout '^\tbuild\tvcs.revision='
66+
stdout '^\tbuild\tvcs.time='
67+
stdout '^\tbuild\tvcs.modified=false$'
6568

6669
# Building with -buildvcs=false suppresses the info.
6770
go install -buildvcs=false
6871
go version -m $GOBIN/a$GOEXE
69-
! stdout bzrrevision
72+
! stdout vcs.revision
7073
rm $GOBIN/a$GOEXE
7174

72-
# An untracked file is shown as uncommitted, even if it isn't part of the build.
75+
# An untracked file is shown as modified, even if it isn't part of the build.
7376
cp ../../outside/empty.txt .
7477
go install
7578
go version -m $GOBIN/a$GOEXE
76-
stdout '^\tbuild\tbzruncommitted\ttrue$'
79+
stdout '^\tbuild\tvcs.modified=true$'
7780
rm empty.txt
7881
rm $GOBIN/a$GOEXE
7982

80-
# An edited file is shown as uncommitted, even if it isn't part of the build.
83+
# An edited file is shown as modified, even if it isn't part of the build.
8184
cp ../../outside/empty.txt ../README
8285
go install
8386
go version -m $GOBIN/a$GOEXE
84-
stdout '^\tbuild\tbzruncommitted\ttrue$'
87+
stdout '^\tbuild\tvcs.modified=true$'
8588
exec bzr revert ../README
8689
rm $GOBIN/a$GOEXE
8790

src/cmd/go/testdata/script/version_buildvcs_fossil.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cd repo/a
1919
# If there's no local repository, there's no VCS info.
2020
go install
2121
go version -m $GOBIN/a$GOEXE
22-
! stdout fossilrevision
22+
! stdout vcs.revision
2323
rm $GOBIN/a$GOEXE
2424

2525
# If there is a repository, but it can't be used for some reason,
@@ -44,30 +44,33 @@ exec fossil commit -m 'initial commit'
4444
cd a
4545
go install
4646
go version -m $GOBIN/a$GOEXE
47-
stdout '^\tbuild\tfossilrevision\t'
48-
stdout '^\tbuild\tfossilcommittime\t'
49-
stdout '^\tbuild\tfossiluncommitted\tfalse$'
47+
stdout '^\tbuild\tvcs=fossil\n'
48+
stdout '^\tbuild\tvcs.revision='
49+
stdout '^\tbuild\tvcs.time='
50+
stdout '^\tbuild\tvcs.modified=false$'
5051
rm $GOBIN/a$GOEXE
5152

5253
# Building with -buildvcs=false suppresses the info.
5354
go install -buildvcs=false
5455
go version -m $GOBIN/a$GOEXE
55-
! stdout fossilrevision
56+
! stdout vcs.revision
5657
rm $GOBIN/a$GOEXE
5758

58-
# An untracked file is shown as uncommitted, even if it isn't part of the build.
59+
# An untracked file is shown as modified, even if it isn't part of the build.
5960
cp ../../outside/empty.txt .
6061
go install
6162
go version -m $GOBIN/a$GOEXE
62-
stdout '^\tbuild\tfossiluncommitted\ttrue$'
63+
stdout '^\tbuild\tvcs=fossil\n'
64+
stdout '^\tbuild\tvcs.modified=true$'
6365
rm empty.txt
6466
rm $GOBIN/a$GOEXE
6567

66-
# An edited file is shown as uncommitted, even if it isn't part of the build.
68+
# An edited file is shown as modified, even if it isn't part of the build.
6769
cp ../../outside/empty.txt ../README
6870
go install
6971
go version -m $GOBIN/a$GOEXE
70-
stdout '^\tbuild\tfossiluncommitted\ttrue$'
72+
stdout '^\tbuild\tvcs=fossil\n'
73+
stdout '^\tbuild\tvcs.modified=true$'
7174
exec fossil revert ../README
7275
rm $GOBIN/a$GOEXE
7376

0 commit comments

Comments
 (0)