Allow 'runs_per_test' to be overridden.
runs_per_test allows multiple argument instances, because there's an
option of using a per-label regex format.
Unlike most such flags, earlier instances of the flag were dominating
later ones.
@@ -16,6 +16,7 @@ package com.google.devtools.build.lib.analysis.test;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration.Fragment;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration.RunsPerTestConverter;
import com.google.devtools.build.lib.analysis.config.BuildOptions;
@@ -194,7 +195,7 @@ public class TestConfiguration extends Fragment {
* filters, runs it once.
*/
public int getRunsPerTestForLabel(Label label) {
- for (PerLabelOptions perLabelRuns : options.runsPerTest) {
+ for (PerLabelOptions perLabelRuns : Lists.reverse(options.runsPerTest)) {
if (perLabelRuns.isIncluded(label)) {
return Integer.parseInt(Iterables.getOnlyElement(perLabelRuns.getOptions()));
}
