summaryrefslogtreecommitdiff
blob: 23b7caa803f09be47b3f2fe51232c039b536091c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Index: soong-8.1.0_p41/build/blueprint/gotestmain/gotestmain.go
===================================================================
--- soong-8.1.0_p41.orig/build/blueprint/gotestmain/gotestmain.go
+++ soong-8.1.0_p41/build/blueprint/gotestmain/gotestmain.go
@@ -105,12 +105,11 @@ var testMainTmpl = template.Must(templat
 package main
 
 import (
-	"io"
 {{if not .HasMain}}
 	"os"
 {{end}}
-	"regexp"
 	"testing"
+	"testing/internal/testdeps"
 
 	pkg "{{.Package}}"
 )
@@ -121,44 +120,9 @@ var t = []testing.InternalTest{
 {{end}}
 }
 
-var matchPat string
-var matchRe *regexp.Regexp
-
-type matchString struct{}
-
-func MatchString(pat, str string) (result bool, err error) {
-	if matchRe == nil || matchPat != pat {
-		matchPat = pat
-		matchRe, err = regexp.Compile(matchPat)
-		if err != nil {
-			return
-		}
-	}
-	return matchRe.MatchString(str), nil
-}
-
-func (matchString) MatchString(pat, str string) (bool, error) {
-	return MatchString(pat, str)
-}
-
-func (matchString) StartCPUProfile(w io.Writer) error {
-	panic("shouldn't get here")
-}
-
-func (matchString) StopCPUProfile() {
-}
-
-func (matchString) WriteHeapProfile(w io.Writer) error {
-    panic("shouldn't get here")
-}
-
-func (matchString) WriteProfileTo(string, io.Writer, int) error {
-    panic("shouldn't get here")
-}
-
 func main() {
 {{if .MainStartTakesInterface}}
-	m := testing.MainStart(matchString{}, t, nil, nil)
+	m := testing.MainStart(testdeps.TestDeps{}, t, nil, nil)
 {{else}}
 	m := testing.MainStart(MatchString, t, nil, nil)
 {{end}}