@@ -23,11 +23,13 @@ import (
23
23
)
24
24
25
25
var (
26
- wait = flag .Bool ("wait" , true , "wait for system idle before starting benchmarking" )
27
- gorootExperiment = flag .String ("goroot" , "" , "GOROOT to test (default $GOROOT or 'go env GOROOT')" )
28
- gorootBaseline = flag .String ("goroot-baseline" , "" , "baseline GOROOT to test against (optional) (default $BENCH_BASELINE_GOROOT)" )
29
- branch = flag .String ("branch" , "" , "branch of the commits we're testing against (default $BENCH_BRANCH or unknown)" )
30
- repository = flag .String ("repository" , "" , "repository name of the commits we're testing against (default $BENCH_REPOSITORY or 'go')" )
26
+ wait = flag .Bool ("wait" , true , "wait for system idle before starting benchmarking" )
27
+ gorootExperiment = flag .String ("goroot" , "" , "GOROOT to test (default $GOROOT or 'go env GOROOT')" )
28
+ gorootBaseline = flag .String ("goroot-baseline" , "" , "baseline GOROOT to test against (optional) (default $BENCH_BASELINE_GOROOT)" )
29
+ branch = flag .String ("branch" , "" , "branch of the commits we're testing against (default $BENCH_BRANCH or unknown)" )
30
+ repository = flag .String ("repository" , "" , "repository name of the commits we're testing against (default $BENCH_REPOSITORY or 'go')" )
31
+ subRepoExperiment = flag .String ("subrepo" , "" , "Sub-repo dir to test (default $BENCH_SUBREPO_PATH)" )
32
+ subRepoBaseline = flag .String ("subrepo-baseline" , "" , "Sub-repo baseline to test against (default $BENCH_SUBREPO_BASELINE_PATH)" )
31
33
)
32
34
33
35
func determineGOROOT () (string , error ) {
@@ -141,11 +143,24 @@ func main() {
141
143
}
142
144
fmt .Printf ("branch: %s\n " , branch )
143
145
144
- if repository != "go" {
145
- // TODO(go.dev/issue/53538): Support other repositories.
146
- log .Fatalf ("Unknown repository %q" , repository )
146
+ subRepoExperiment := * subRepoExperiment
147
+ if subRepoExperiment == "" {
148
+ subRepoExperiment = os .Getenv ("BENCH_SUBREPO_PATH" )
149
+ }
150
+ subRepoBaseline := * subRepoBaseline
151
+ if subRepoBaseline == "" {
152
+ subRepoBaseline = os .Getenv ("BENCH_SUBREPO_BASELINE_PATH" )
147
153
}
154
+ dirs := []string {subRepoExperiment , subRepoBaseline }
148
155
156
+ if repository != "go" {
157
+ toolchain := toolchainFromGOROOT ("baseline" , gorootBaseline )
158
+ if err := goTestSubrepo (toolchain , repository , dirs ); err != nil {
159
+ log .Print ("FAIL" )
160
+ os .Exit (1 )
161
+ }
162
+ return
163
+ }
149
164
// Run benchmarks against the toolchains.
150
165
if err := run (toolchains ); err != nil {
151
166
log .Print ("FAIL" )
0 commit comments