@@ -21,6 +21,7 @@ const (
2121 importBenchBreakdown = "WIRE_IMPORT_BENCH_BREAKDOWN"
2222 importBenchScenarios = "WIRE_IMPORT_BENCH_SCENARIOS"
2323 importBenchScenarioBD = "WIRE_IMPORT_BENCH_SCENARIO_BREAKDOWN"
24+ importBenchProfile = "WIRE_IMPORT_BENCH_PROFILE"
2425 stockWireCommit = "9c25c9016f6825302537c4efdd5e897976f9c826"
2526 stockWireModulePath = "github.com/google/wire"
2627 currentWireModulePath = "github.com/goforj/wire"
@@ -145,6 +146,18 @@ func TestPrintImportScenarioBenchmarkTable(t *testing.T) {
145146 {localPkgs : 10 , depPkgs : 25 , external : true , label : "external" },
146147 {localPkgs : 10 , depPkgs : 100 , external : true , label : "external" },
147148 }
149+ if filter := os .Getenv (importBenchProfile ); filter != "" {
150+ filtered := make ([]appBenchProfile , 0 , len (profiles ))
151+ for _ , profile := range profiles {
152+ if profile .label == filter {
153+ filtered = append (filtered , profile )
154+ }
155+ }
156+ if len (filtered ) == 0 {
157+ t .Fatalf ("%s=%q did not match any benchmark profile" , importBenchProfile , filter )
158+ }
159+ profiles = filtered
160+ }
148161 rows := make ([]importBenchScenarioRow , 0 , len (profiles )* 6 )
149162 for _ , profile := range profiles {
150163 shapeFixture := createAppShapeBenchFixture (t , profile .localPkgs , profile .depPkgs , profile .external , currentWireModulePath , repoRoot )
0 commit comments