Commit 6a3ad481 authored by Shenghou Ma's avatar Shenghou Ma

cmd/go: make package list order predicable

also add a cleanup phase to cmd/go/test.bash.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6741050
parent bcdb7926
...@@ -674,12 +674,11 @@ func packagesAndErrors(args []string) []*Package { ...@@ -674,12 +674,11 @@ func packagesAndErrors(args []string) []*Package {
var set = make(map[string]bool) var set = make(map[string]bool)
for _, arg := range args { for _, arg := range args {
set[arg] = true if !set[arg] {
} pkgs = append(pkgs, loadPackage(arg, &stk))
for arg := range set { set[arg] = true
pkgs = append(pkgs, loadPackage(arg, &stk)) }
} }
computeStale(pkgs...) computeStale(pkgs...)
return pkgs return pkgs
......
...@@ -142,6 +142,18 @@ if [ $(./testgo test fmt fmt fmt fmt fmt | wc -l) -ne 1 ] ; then ...@@ -142,6 +142,18 @@ if [ $(./testgo test fmt fmt fmt fmt fmt | wc -l) -ne 1 ] ; then
ok=false ok=false
fi fi
# ensure that output of 'go list' is consistent between runs
./testgo list std > test_std.list
if ! ./testgo list std | cmp -s test_std.list - ; then
echo "go list std ordering is inconsistent"
ok=false
fi
rm -f test_std.list
# clean up
rm -rf testdata/bin testdata/bin1
rm -f testgo
if $ok; then if $ok; then
echo PASS echo PASS
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment