From 8d5ff2e182c52c4fa6af18e536dcef6e12ad8cb2 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 21 Dec 2015 10:29:21 -0500 Subject: runtime: move test programs out of source code, coalesce MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now there are just three programs to compile instead of many, and repeated tests can reuse the compilation result instead of rebuilding it. Combined, these changes reduce the time spent testing runtime during all.bash on my laptop from about 60 to about 30 seconds. (All.bash itself runs in 5½ minutes.) For #10571. Change-Id: Ie2c1798b847f1a635a860d11dcdab14375319ae9 Reviewed-on: https://go-review.googlesource.com/18085 Reviewed-by: Austin Clements Run-TryBot: Austin Clements --- src/runtime/string_test.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/runtime/string_test.go') diff --git a/src/runtime/string_test.go b/src/runtime/string_test.go index dfda950bdd..318a5532e5 100644 --- a/src/runtime/string_test.go +++ b/src/runtime/string_test.go @@ -125,7 +125,7 @@ func TestStringW(t *testing.T) { } func TestLargeStringConcat(t *testing.T) { - output := executeTest(t, largeStringConcatSource, nil) + output := runTestProg(t, "testprog", "stringconcat") want := "panic: " + strings.Repeat("0", 1<<10) + strings.Repeat("1", 1<<10) + strings.Repeat("2", 1<<10) + strings.Repeat("3", 1<<10) if !strings.HasPrefix(output, want) { @@ -133,19 +133,6 @@ func TestLargeStringConcat(t *testing.T) { } } -var largeStringConcatSource = ` -package main -import "strings" -func main() { - s0 := strings.Repeat("0", 1<<10) - s1 := strings.Repeat("1", 1<<10) - s2 := strings.Repeat("2", 1<<10) - s3 := strings.Repeat("3", 1<<10) - s := s0 + s1 + s2 + s3 - panic(s) -} -` - func TestGostringnocopy(t *testing.T) { max := *runtime.Maxstring b := make([]byte, max+10) -- cgit v1.3