use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class TreeNodeRepositoryTest method setRootDir.
@Before
public final void setRootDir() throws Exception {
scratch = new Scratch();
rootDir = Root.asDerivedRoot(scratch.dir("/exec/root"));
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class JarDecompressorTest method setUpFs.
@Before
public void setUpFs() throws Exception {
Scratch fs = new Scratch();
Path dir = fs.dir("/whatever/external/tester");
Path jar = fs.file("/foo.jar", "I'm a jar");
FileSystemUtils.createDirectoryAndParents(dir);
descriptorBuilder = DecompressorDescriptor.builder().setDecompressor(JarDecompressor.INSTANCE).setTargetName("tester").setTargetKind("http_jar rule").setRepositoryPath(dir).setArchivePath(jar);
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class CommandInterruptionTest method setUp.
@Before
public void setUp() throws Exception {
executor = Executors.newSingleThreadExecutor();
Scratch scratch = new Scratch();
isTestShuttingDown = new AtomicBoolean(false);
String productName = TestConstants.PRODUCT_NAME;
ServerDirectories serverDirectories = new ServerDirectories(scratch.dir("install"), scratch.dir("output"));
BlazeRuntime runtime = new BlazeRuntime.Builder().setProductName(productName).setServerDirectories(serverDirectories).setStartupOptionsProvider(OptionsParser.newOptionsParser(BlazeServerStartupOptions.class)).addBlazeModule(new BlazeModule() {
@Override
public void initializeRuleClasses(ConfiguredRuleClassProvider.Builder builder) {
// Can't create a Skylark environment without a tools repository!
builder.setToolsRepository(TestConstants.TOOLS_REPOSITORY);
// Can't create a runtime without a configuration collection factory!
builder.setConfigurationCollectionFactory(Mockito.mock(ConfigurationCollectionFactory.class));
// Can't create a defaults package without the base options in there!
builder.addConfigurationOptions(BuildConfiguration.Options.class);
}
}).build();
snooze = new WaitForCompletionCommand(isTestShuttingDown);
dispatcher = new BlazeCommandDispatcher(runtime, snooze);
BlazeDirectories blazeDirectories = new BlazeDirectories(serverDirectories, scratch.dir("workspace"), productName);
runtime.initWorkspace(blazeDirectories, /*bintools=*/
null);
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class CompositeRunfilesSupplierTest method createMocks.
@Before
public final void createMocks() throws IOException {
Scratch scratch = new Scratch();
rootDir = Root.asDerivedRoot(scratch.dir("/fake/root/dont/matter"));
mockFirst = mock(RunfilesSupplier.class);
mockSecond = mock(RunfilesSupplier.class);
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class ArtifactTest method setRootDir.
@Before
public final void setRootDir() throws Exception {
scratch = new Scratch();
execDir = scratch.dir("/exec");
rootDir = Root.asDerivedRoot(scratch.dir("/exec/root"));
}
Aggregations