diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2020-01-09 23:14:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2020-01-09 23:14:57 +0000 |
commit | fcee603081c754044e682f9263f526fcefc9442c (patch) | |
tree | fd799d5e04409a5f50a3570151d4ef62c558bb09 /libgo/go | |
parent | acd43917df56f8845b1497d939da97f4e22b5ebb (diff) | |
download | gcc-fcee603081c754044e682f9263f526fcefc9442c.zip gcc-fcee603081c754044e682f9263f526fcefc9442c.tar.gz gcc-fcee603081c754044e682f9263f526fcefc9442c.tar.bz2 |
libgo: compile examples in _test packages
Previously if the only names defined by _test packages were examples,
the gotest script would emit an incorrect _testmain.go file.
I worked around that by marking the example_test.go files +build ignored.
This CL changes the gotest script to handle this case correctly,
and removes the now-unnecessary build tags.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/214039
From-SVN: r280085
Diffstat (limited to 'libgo/go')
42 files changed, 4 insertions, 82 deletions
diff --git a/libgo/go/compress/flate/example_test.go b/libgo/go/compress/flate/example_test.go index 3d44dde..5780092 100644 --- a/libgo/go/compress/flate/example_test.go +++ b/libgo/go/compress/flate/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package flate_test import ( diff --git a/libgo/go/compress/gzip/example_test.go b/libgo/go/compress/gzip/example_test.go index 4764bcb..ce29e9b 100644 --- a/libgo/go/compress/gzip/example_test.go +++ b/libgo/go/compress/gzip/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package gzip_test import ( diff --git a/libgo/go/container/ring/example_test.go b/libgo/go/container/ring/example_test.go index d8f1639..30bd0d7 100644 --- a/libgo/go/container/ring/example_test.go +++ b/libgo/go/container/ring/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package ring_test import ( diff --git a/libgo/go/crypto/sha256/example_test.go b/libgo/go/crypto/sha256/example_test.go index 89d5c97..7d73120 100644 --- a/libgo/go/crypto/sha256/example_test.go +++ b/libgo/go/crypto/sha256/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package sha256_test import ( diff --git a/libgo/go/database/sql/example_cli_test.go b/libgo/go/database/sql/example_cli_test.go index c87c508..8c61d75 100644 --- a/libgo/go/database/sql/example_cli_test.go +++ b/libgo/go/database/sql/example_cli_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package sql_test import ( diff --git a/libgo/go/database/sql/example_service_test.go b/libgo/go/database/sql/example_service_test.go index 7605e2f..768307c 100644 --- a/libgo/go/database/sql/example_service_test.go +++ b/libgo/go/database/sql/example_service_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package sql_test import ( diff --git a/libgo/go/encoding/csv/example_test.go b/libgo/go/encoding/csv/example_test.go index e3c3bd5..dc227d4 100644 --- a/libgo/go/encoding/csv/example_test.go +++ b/libgo/go/encoding/csv/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package csv_test import ( diff --git a/libgo/go/encoding/hex/example_test.go b/libgo/go/encoding/hex/example_test.go index fb1554e..3580757 100644 --- a/libgo/go/encoding/hex/example_test.go +++ b/libgo/go/encoding/hex/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package hex_test import ( diff --git a/libgo/go/encoding/json/example_marshaling_test.go b/libgo/go/encoding/json/example_marshaling_test.go index 1c4f783..7f15c74 100644 --- a/libgo/go/encoding/json/example_marshaling_test.go +++ b/libgo/go/encoding/json/example_marshaling_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package json_test import ( diff --git a/libgo/go/encoding/json/example_text_marshaling_test.go b/libgo/go/encoding/json/example_text_marshaling_test.go index a8a3f83..04c7813 100644 --- a/libgo/go/encoding/json/example_text_marshaling_test.go +++ b/libgo/go/encoding/json/example_text_marshaling_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package json_test import ( diff --git a/libgo/go/encoding/pem/example_test.go b/libgo/go/encoding/pem/example_test.go index 22081b4..806e7bb 100644 --- a/libgo/go/encoding/pem/example_test.go +++ b/libgo/go/encoding/pem/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package pem_test import ( diff --git a/libgo/go/encoding/xml/example_marshaling_test.go b/libgo/go/encoding/xml/example_marshaling_test.go index 04d3470..9f9e801 100644 --- a/libgo/go/encoding/xml/example_marshaling_test.go +++ b/libgo/go/encoding/xml/example_marshaling_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package xml_test import ( diff --git a/libgo/go/encoding/xml/example_text_marshaling_test.go b/libgo/go/encoding/xml/example_text_marshaling_test.go index 8d1f332..2549cb1 100644 --- a/libgo/go/encoding/xml/example_text_marshaling_test.go +++ b/libgo/go/encoding/xml/example_text_marshaling_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package xml_test import ( diff --git a/libgo/go/fmt/example_test.go b/libgo/go/fmt/example_test.go index ae60abe..5962834 100644 --- a/libgo/go/fmt/example_test.go +++ b/libgo/go/fmt/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package fmt_test import ( diff --git a/libgo/go/fmt/gostringer_example_test.go b/libgo/go/fmt/gostringer_example_test.go index 7c6b9f0..ab19ee3 100644 --- a/libgo/go/fmt/gostringer_example_test.go +++ b/libgo/go/fmt/gostringer_example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package fmt_test import ( diff --git a/libgo/go/fmt/stringer_example_test.go b/libgo/go/fmt/stringer_example_test.go index aa3cd05..c77e788 100644 --- a/libgo/go/fmt/stringer_example_test.go +++ b/libgo/go/fmt/stringer_example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package fmt_test import ( diff --git a/libgo/go/go/types/example_test.go b/libgo/go/go/types/example_test.go index a2e481b..5619d20 100644 --- a/libgo/go/go/types/example_test.go +++ b/libgo/go/go/types/example_test.go @@ -5,7 +5,7 @@ // Only run where builders (build.golang.org) have // access to compiled packages for import. // -// +build ignore,!arm,!arm64,!nacl +// +build !arm,!arm64,!nacl package types_test @@ -77,7 +77,7 @@ func Unused() { {}; {{ var x int; _ = x }} } // make sure empty block scopes get rx := regexp.MustCompile(` 0x[a-fA-F0-9]*`) fmt.Println(rx.ReplaceAllString(buf.String(), "")) - // Output: + // no output for gccgo--can't import "fmt" // package "temperature" scope { // . const temperature.Boiling temperature.Celsius // . type temperature.Celsius float64 @@ -147,7 +147,7 @@ func (c *Celsius) SetF(f float64) { *c = Celsius(f - 32 / 9 * 5) } fmt.Println() } - // Output: + // no output for gccgo--can't import "fmt" // Method set of temperature.Celsius: // method (temperature.Celsius) String() string // diff --git a/libgo/go/hash/crc32/example_test.go b/libgo/go/hash/crc32/example_test.go index a1d9e16..621bf83 100644 --- a/libgo/go/hash/crc32/example_test.go +++ b/libgo/go/hash/crc32/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package crc32_test import ( diff --git a/libgo/go/hash/example_test.go b/libgo/go/hash/example_test.go index 49dc8fc..f07b9aa 100644 --- a/libgo/go/hash/example_test.go +++ b/libgo/go/hash/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package hash_test import ( diff --git a/libgo/go/html/example_test.go b/libgo/go/html/example_test.go index d0f0a9b..0e28cac 100644 --- a/libgo/go/html/example_test.go +++ b/libgo/go/html/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package html_test import ( diff --git a/libgo/go/html/template/example_test.go b/libgo/go/html/template/example_test.go index 80107a63..533c0dd 100644 --- a/libgo/go/html/template/example_test.go +++ b/libgo/go/html/template/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package template_test import ( diff --git a/libgo/go/html/template/examplefiles_test.go b/libgo/go/html/template/examplefiles_test.go index ffca8d5..60518ae 100644 --- a/libgo/go/html/template/examplefiles_test.go +++ b/libgo/go/html/template/examplefiles_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package template_test import ( diff --git a/libgo/go/image/draw/example_test.go b/libgo/go/image/draw/example_test.go index d381c1c..2ccc2f4 100644 --- a/libgo/go/image/draw/example_test.go +++ b/libgo/go/image/draw/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package draw_test import ( diff --git a/libgo/go/image/png/example_test.go b/libgo/go/image/png/example_test.go index 2a03be5..c437632 100644 --- a/libgo/go/image/png/example_test.go +++ b/libgo/go/image/png/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package png_test import ( diff --git a/libgo/go/index/suffixarray/example_test.go b/libgo/go/index/suffixarray/example_test.go index a23a580..ea10bfd 100644 --- a/libgo/go/index/suffixarray/example_test.go +++ b/libgo/go/index/suffixarray/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package suffixarray_test import ( diff --git a/libgo/go/io/ioutil/example_test.go b/libgo/go/io/ioutil/example_test.go index 3066c94..a7d340b 100644 --- a/libgo/go/io/ioutil/example_test.go +++ b/libgo/go/io/ioutil/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package ioutil_test import ( diff --git a/libgo/go/io/ioutil/testdata/hello b/libgo/go/io/ioutil/testdata/hello new file mode 100644 index 0000000..e47c092 --- /dev/null +++ b/libgo/go/io/ioutil/testdata/hello @@ -0,0 +1 @@ +Hello, Gophers! diff --git a/libgo/go/log/syslog/example_test.go b/libgo/go/log/syslog/example_test.go index 0513b26..3d5b76d 100644 --- a/libgo/go/log/syslog/example_test.go +++ b/libgo/go/log/syslog/example_test.go @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore // +build !windows,!nacl,!plan9 package syslog_test diff --git a/libgo/go/math/big/example_rat_test.go b/libgo/go/math/big/example_rat_test.go index f3127bb..a971170 100644 --- a/libgo/go/math/big/example_rat_test.go +++ b/libgo/go/math/big/example_rat_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package big_test import ( diff --git a/libgo/go/math/big/floatexample_test.go b/libgo/go/math/big/floatexample_test.go index 8645c44..0c6668c 100644 --- a/libgo/go/math/big/floatexample_test.go +++ b/libgo/go/math/big/floatexample_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package big_test import ( diff --git a/libgo/go/math/bits/example_test.go b/libgo/go/math/bits/example_test.go index 14cea6f..b2ed2cb 100644 --- a/libgo/go/math/bits/example_test.go +++ b/libgo/go/math/bits/example_test.go @@ -4,8 +4,6 @@ // Code generated by go run make_examples.go. DO NOT EDIT. -// +build ignore - package bits_test import ( diff --git a/libgo/go/math/cmplx/example_test.go b/libgo/go/math/cmplx/example_test.go index be87cff..f0ed963 100644 --- a/libgo/go/math/cmplx/example_test.go +++ b/libgo/go/math/cmplx/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package cmplx_test import ( diff --git a/libgo/go/mime/example_test.go b/libgo/go/mime/example_test.go index 12aafdc..c7d13cd 100644 --- a/libgo/go/mime/example_test.go +++ b/libgo/go/mime/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package mime_test import ( diff --git a/libgo/go/mime/quotedprintable/example_test.go b/libgo/go/mime/quotedprintable/example_test.go index 0593b04..5a9ab45 100644 --- a/libgo/go/mime/quotedprintable/example_test.go +++ b/libgo/go/mime/quotedprintable/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package quotedprintable_test import ( diff --git a/libgo/go/net/http/cookiejar/dummy_publicsuffix_test.go b/libgo/go/net/http/cookiejar/dummy_publicsuffix_test.go index 748ec5c..9b31173 100644 --- a/libgo/go/net/http/cookiejar/dummy_publicsuffix_test.go +++ b/libgo/go/net/http/cookiejar/dummy_publicsuffix_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package cookiejar_test import "net/http/cookiejar" diff --git a/libgo/go/net/http/cookiejar/example_test.go b/libgo/go/net/http/cookiejar/example_test.go index 19a5746..91728ca 100644 --- a/libgo/go/net/http/cookiejar/example_test.go +++ b/libgo/go/net/http/cookiejar/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package cookiejar_test import ( diff --git a/libgo/go/net/http/httptrace/example_test.go b/libgo/go/net/http/httptrace/example_test.go index 27cdcde..07fdc0a 100644 --- a/libgo/go/net/http/httptrace/example_test.go +++ b/libgo/go/net/http/httptrace/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package httptrace_test import ( diff --git a/libgo/go/net/http/httputil/example_test.go b/libgo/go/net/http/httputil/example_test.go index e8dc962..6191603 100644 --- a/libgo/go/net/http/httputil/example_test.go +++ b/libgo/go/net/http/httputil/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package httputil_test import ( diff --git a/libgo/go/net/mail/example_test.go b/libgo/go/net/mail/example_test.go index 972cfd6..c336564 100644 --- a/libgo/go/net/mail/example_test.go +++ b/libgo/go/net/mail/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package mail_test import ( diff --git a/libgo/go/path/filepath/example_test.go b/libgo/go/path/filepath/example_test.go index d019c26..a1d680e 100644 --- a/libgo/go/path/filepath/example_test.go +++ b/libgo/go/path/filepath/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package filepath_test import ( diff --git a/libgo/go/runtime/trace/example_test.go b/libgo/go/runtime/trace/example_test.go index 8e0ee5a..ba96a82 100644 --- a/libgo/go/runtime/trace/example_test.go +++ b/libgo/go/runtime/trace/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package trace_test import ( diff --git a/libgo/go/text/scanner/example_test.go b/libgo/go/text/scanner/example_test.go index 88b992b..5e8c3fb 100644 --- a/libgo/go/text/scanner/example_test.go +++ b/libgo/go/text/scanner/example_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build ignore - package scanner_test import ( |