use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class FingerprintTest method addPath.
@Test
public void addPath() throws Exception {
PathFragment pf = new PathFragment("/etc/pwd");
assertThat(new Fingerprint().addPath(pf).hexDigestAndReset()).isEqualTo("63ab5c47c117635407a1af6377e216bc");
Path p = new InMemoryFileSystem(BlazeClock.instance()).getPath(pf);
assertThat(new Fingerprint().addPath(p).hexDigestAndReset()).isEqualTo("63ab5c47c117635407a1af6377e216bc");
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class RootedPathTest method initializeFileSystem.
@Before
public final void initializeFileSystem() throws Exception {
filesystem = new InMemoryFileSystem(BlazeClock.instance());
root = filesystem.getRootDirectory();
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class SymlinkForestTest method initializeFileSystem.
@Before
public final void initializeFileSystem() throws Exception {
ManualClock clock = new ManualClock();
fileSystem = new InMemoryFileSystem(clock);
linkRoot = fileSystem.getPath("/linkRoot");
createDirectoryAndParents(linkRoot);
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class BlazeExecutorTest method setUpDirectoriesAndTools.
@Before
public final void setUpDirectoriesAndTools() throws Exception {
InMemoryFileSystem fs = new InMemoryFileSystem();
directories = new BlazeDirectories(fs.getPath("/install"), fs.getPath("/base"), fs.getPath("/workspace"), "mock-product-name");
binTools = BinTools.empty(directories);
}
use of com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem in project bazel by bazelbuild.
the class SingleBuildFileCacheTest method setUp.
@Before
public final void setUp() throws Exception {
calls = new HashMap<>();
md5Overrides = new HashMap<>();
fs = new InMemoryFileSystem() {
@Override
protected InputStream getInputStream(Path path) throws IOException {
int c = calls.containsKey(path.toString()) ? calls.get(path.toString()) : 0;
c++;
calls.put(path.toString(), c);
return super.getInputStream(path);
}
@Override
protected byte[] getMD5Digest(Path path) throws IOException {
byte[] override = md5Overrides.get(path.getPathString());
return override != null ? override : super.getMD5Digest(path);
}
};
underTest = new SingleBuildFileCache("/", fs);
Path root = fs.getRootDirectory();
Path file = root.getChild("empty");
file.getOutputStream().close();
}
Aggregations