Commit 2b780af0 authored by Elias Naur's avatar Elias Naur

Revert "all: test adjustments for the iOS builder"

This reverts commit 467109bf.

Replaced by a improved strategy later in the CL relation chain.

Change-Id: Ib90813b5a6c4716b563c8496013d2d57f9c022b8
Reviewed-on: https://go-review.googlesource.com/36066Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 870d079c
...@@ -525,11 +525,13 @@ func copyLocalData(dstbase string) (pkgpath string, err error) { ...@@ -525,11 +525,13 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
// Copy timezone file. // Copy timezone file.
// //
// Apps have the zoneinfo.zip in the root of their app bundle, // Typical apps have the zoneinfo.zip in the root of their app bundle,
// read by the time package as the working directory at initialization. // read by the time package as the working directory at initialization.
// As we move the working directory to the GOROOT pkg directory, we
// install the zoneinfo.zip file in the pkgpath.
if underGoRoot { if underGoRoot {
err := cp( err := cp(
dstbase, filepath.Join(dstbase, pkgpath),
filepath.Join(cwd, "lib", "time", "zoneinfo.zip"), filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
) )
if err != nil { if err != nil {
......
...@@ -204,6 +204,12 @@ func TestMTF(t *testing.T) { ...@@ -204,6 +204,12 @@ func TestMTF(t *testing.T) {
} }
} }
var (
digits = mustLoadFile("testdata/e.txt.bz2")
twain = mustLoadFile("testdata/Mark.Twain-Tom.Sawyer.txt.bz2")
random = mustLoadFile("testdata/random.data.bz2")
)
func benchmarkDecode(b *testing.B, compressed []byte) { func benchmarkDecode(b *testing.B, compressed []byte) {
// Determine the uncompressed size of testfile. // Determine the uncompressed size of testfile.
uncompressedSize, err := io.Copy(ioutil.Discard, NewReader(bytes.NewReader(compressed))) uncompressedSize, err := io.Copy(ioutil.Discard, NewReader(bytes.NewReader(compressed)))
...@@ -221,18 +227,6 @@ func benchmarkDecode(b *testing.B, compressed []byte) { ...@@ -221,18 +227,6 @@ func benchmarkDecode(b *testing.B, compressed []byte) {
} }
} }
func BenchmarkDecodeDigits(b *testing.B) { func BenchmarkDecodeDigits(b *testing.B) { benchmarkDecode(b, digits) }
digits := mustLoadFile("testdata/e.txt.bz2") func BenchmarkDecodeTwain(b *testing.B) { benchmarkDecode(b, twain) }
b.ResetTimer() func BenchmarkDecodeRand(b *testing.B) { benchmarkDecode(b, random) }
benchmarkDecode(b, digits)
}
func BenchmarkDecodeTwain(b *testing.B) {
twain := mustLoadFile("testdata/Mark.Twain-Tom.Sawyer.txt.bz2")
b.ResetTimer()
benchmarkDecode(b, twain)
}
func BenchmarkDecodeRand(b *testing.B) {
random := mustLoadFile("testdata/random.data.bz2")
b.ResetTimer()
benchmarkDecode(b, random)
}
...@@ -25,7 +25,7 @@ var files = flag.String("files", "", "consider only Go test files matching this ...@@ -25,7 +25,7 @@ var files = flag.String("files", "", "consider only Go test files matching this
const dataDir = "testdata" const dataDir = "testdata"
var templateTxt *template.Template var templateTxt = readTemplate("template.txt")
func readTemplate(filename string) *template.Template { func readTemplate(filename string) *template.Template {
t := template.New(filename) t := template.New(filename)
...@@ -96,9 +96,6 @@ func test(t *testing.T, mode Mode) { ...@@ -96,9 +96,6 @@ func test(t *testing.T, mode Mode) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
if templateTxt == nil {
templateTxt = readTemplate("template.txt")
}
// test packages // test packages
for _, pkg := range pkgs { for _, pkg := range pkgs {
......
...@@ -10,12 +10,17 @@ import ( ...@@ -10,12 +10,17 @@ import (
"testing" "testing"
) )
func BenchmarkParse(b *testing.B) { var src = readFile("parser.go")
src, err := ioutil.ReadFile("parser.go")
func readFile(filename string) []byte {
data, err := ioutil.ReadFile(filename)
if err != nil { if err != nil {
b.Fatal(err) panic(err)
} }
b.ResetTimer() return data
}
func BenchmarkParse(b *testing.B) {
b.SetBytes(int64(len(src))) b.SetBytes(int64(len(src)))
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
if _, err := ParseFile(token.NewFileSet(), "", src, ParseComments); err != nil { if _, err := ParseFile(token.NewFileSet(), "", src, ParseComments); err != nil {
......
...@@ -55,15 +55,12 @@ var sysdir = func() *sysDir { ...@@ -55,15 +55,12 @@ var sysdir = func() *sysDir {
case "darwin": case "darwin":
switch runtime.GOARCH { switch runtime.GOARCH {
case "arm", "arm64": case "arm", "arm64":
/// At this point the test harness has not had a chance
// to move us into the ./src/os directory, so the
// current working directory is the root of the app.
wd, err := syscall.Getwd() wd, err := syscall.Getwd()
if err != nil { if err != nil {
wd = err.Error() wd = err.Error()
} }
return &sysDir{ return &sysDir{
wd, filepath.Join(wd, "..", ".."),
[]string{ []string{
"ResourceRules.plist", "ResourceRules.plist",
"Info.plist", "Info.plist",
......
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