use of com.google.devtools.build.lib.testutil.ManualClock in project bazel by bazelbuild.
the class IncrementalLoadingTest method createTester.
@Before
public final void createTester() throws Exception {
ManualClock clock = new ManualClock();
FileSystem fs = new InMemoryFileSystem(clock) {
@Override
public Collection<Dirent> readdir(Path path, boolean followSymlinks) throws IOException {
if (path.equals(throwOnReaddir)) {
throw new FileNotFoundException(path.getPathString());
}
return super.readdir(path, followSymlinks);
}
@Nullable
@Override
public FileStatus stat(Path path, boolean followSymlinks) throws IOException {
if (path.equals(throwOnStat)) {
throw new IOException("bork " + path.getPathString());
}
return super.stat(path, followSymlinks);
}
};
tester = createTester(fs, clock);
}
use of com.google.devtools.build.lib.testutil.ManualClock in project bazel by bazelbuild.
the class GlobFunctionTest method setUp.
@Before
public final void setUp() throws Exception {
fs = new CustomInMemoryFs(new ManualClock());
root = fs.getRootDirectory().getRelative("root/workspace");
writableRoot = fs.getRootDirectory().getRelative("writableRoot/workspace");
outputBase = fs.getRootDirectory().getRelative("output_base");
pkgPath = root.getRelative(PKG_ID.getPackageFragment());
pkgLocator = new AtomicReference<>(new PathPackageLocator(outputBase, ImmutableList.of(writableRoot, root)));
differencer = new RecordingDifferencer();
evaluator = new InMemoryMemoizingEvaluator(createFunctionMap(), differencer);
driver = new SequentialBuildDriver(evaluator);
PrecomputedValue.BUILD_ID.set(differencer, UUID.randomUUID());
PrecomputedValue.PATH_PACKAGE_LOCATOR.set(differencer, pkgLocator.get());
PrecomputedValue.BLACKLISTED_PACKAGE_PREFIXES_FILE.set(differencer, PathFragment.EMPTY_FRAGMENT);
createTestFiles();
}
use of com.google.devtools.build.lib.testutil.ManualClock in project bazel by bazelbuild.
the class FileFunctionTest method createFsAndRoot.
@Before
public final void createFsAndRoot() throws Exception {
fastDigest = true;
manualClock = new ManualClock();
createFsAndRoot(new CustomInMemoryFs(manualClock));
}
Aggregations