use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class CustomCommandLineTest method createArtifacts.
@Before
public void createArtifacts() throws Exception {
scratch = new Scratch();
rootDir = Root.asDerivedRoot(scratch.dir("/exec/root"));
artifact1 = new Artifact(scratch.file("/exec/root/dir/file1.txt"), rootDir);
artifact2 = new Artifact(scratch.file("/exec/root/dir/file2.txt"), rootDir);
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class SpawnActionTemplateTest method setRootDir.
@Before
public void setRootDir() throws Exception {
Scratch scratch = new Scratch();
root = Root.asDerivedRoot(scratch.dir("/exec/root"));
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class RunfilesSupplierImplTest method setRoot.
@Before
public final void setRoot() throws IOException {
Scratch scratch = new Scratch();
rootDir = Root.asDerivedRoot(scratch.dir("/fake/root/dont/matter"));
Path middlemanExecPath = scratch.dir("/still/fake/root/dont/matter");
middlemanRoot = Root.middlemanRoot(middlemanExecPath, middlemanExecPath.getChild("subdir"));
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class SkylarkRepositoryContextTest method setUp.
@Before
public void setUp() throws Exception {
scratch = new Scratch("/");
outputDirectory = scratch.dir("/outputDir");
workspaceFile = scratch.file("/WORKSPACE");
}
use of com.google.devtools.build.lib.testutil.Scratch in project bazel by bazelbuild.
the class ProfilerChartTest method createProfileInfo.
private ProfileInfo createProfileInfo(Runnable runnable, int noOfRows) throws Exception {
Scratch scratch = new Scratch();
Path cacheDir = scratch.dir("/tmp");
Path cacheFile = cacheDir.getRelative("profile1.dat");
Profiler profiler = Profiler.instance();
profiler.start(ProfiledTaskKinds.ALL, cacheFile.getOutputStream(), "basic test", false, BlazeClock.instance(), BlazeClock.instance().nanoTime());
// Write from multiple threads to generate multiple rows in the chart.
for (int i = 0; i < noOfRows; i++) {
Thread t = new Thread(runnable);
t.start();
t.join();
}
profiler.stop();
return ProfileInfo.loadProfile(cacheFile);
}
Aggregations