use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class SpawnInputExpanderTest method createSpawnInputExpander.
@Before
public final void createSpawnInputExpander() throws Exception {
fs = new InMemoryFileSystem();
expander = new SpawnInputExpander(/*strict=*/
true);
inputMappings = Maps.newHashMap();
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class DiffAwarenessManagerTest method createFileSystem.
@Before
public final void createFileSystem() throws Exception {
fs = new InMemoryFileSystem();
root = fs.getRootDirectory();
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class FsApparatus method createUnixTempDir.
/**
* Create a fresh directory in the system temporary directory, instead of the
* testing directory provided by the testing framework. This path is usually
* shorter than a path starting with TestUtil.getTmpDir(). We care about the
* length because of the path length restriction for Unix local socket files.
*
* Clients are responsible for deleting the directory after tests.
*/
public Path createUnixTempDir() throws IOException {
if (fileSystem instanceof InMemoryFileSystem) {
throw new IOException("Can not create Unix temporary directories in " + "an in-memory file system");
}
File file = File.createTempFile("scratch", "tmp");
final Path path = fileSystem.getPath(file.getAbsolutePath());
path.delete();
path.createDirectory();
return path;
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class FileSystemUtilsTest method initializeFileSystem.
@Before
public final void initializeFileSystem() throws Exception {
clock = new ManualClock();
fileSystem = new InMemoryFileSystem(clock);
workingDir = fileSystem.getPath("/workingDir");
workingDir.createDirectory();
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class FileTypeTest method handlesPathObjects.
@Test
public void handlesPathObjects() {
Path readme = new InMemoryFileSystem().getPath("/readme.txt");
assertTrue(TEXT.matches(readme));
}
Aggregations