use of com.google.devtools.common.options.OptionsBase in project bazel by bazelbuild.
the class BuildEventStreamerModuleTest method testReturnsBuildEventStreamerOptions.
@Test
public void testReturnsBuildEventStreamerOptions() throws Exception {
BuildEventStreamerModule module = new BuildEventStreamerModule();
Iterable<Class<? extends OptionsBase>> commandOptions = module.getCommandOptions(command);
assertThat(commandOptions).isNotEmpty();
OptionsParser optionsParser = OptionsParser.newOptionsParser(commandOptions);
optionsParser.parse("--experimental_build_event_text_file", "/tmp/foo.txt", "--experimental_build_event_binary_file", "/tmp/foo.bin");
BuildEventStreamOptions options = optionsParser.getOptions(BuildEventStreamOptions.class);
assertThat(options.getBuildEventTextFile()).isEqualTo("/tmp/foo.txt");
assertThat(options.getBuildEventBinaryFile()).isEqualTo("/tmp/foo.bin");
}
use of com.google.devtools.common.options.OptionsBase in project bazel by bazelbuild.
the class ConfigurationTestCase method createCollection.
protected BuildConfigurationCollection createCollection(String... args) throws Exception {
OptionsParser parser = OptionsParser.newOptionsParser(ImmutableList.<Class<? extends OptionsBase>>builder().addAll(buildOptionClasses).add(TestOptions.class).build());
parser.parse(args);
InvocationPolicyEnforcer optionsPolicyEnforcer = analysisMock.getInvocationPolicyEnforcer();
optionsPolicyEnforcer.enforce(parser);
ImmutableSortedSet<String> multiCpu = ImmutableSortedSet.copyOf(parser.getOptions(TestOptions.class).multiCpus);
BuildOptions buildOptions = BuildOptions.applyStaticConfigOverride(BuildOptions.of(buildOptionClasses, parser));
skyframeExecutor.handleDiffs(reporter);
BuildConfigurationCollection collection = skyframeExecutor.createConfigurations(reporter, configurationFactory, buildOptions, multiCpu, false);
return collection;
}
Aggregations