blob: f558932999bbcb1c885de4f169bcb11c68b70aea [file] [log] [blame]
// Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.android.tools.r8.benchmarks;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.rules.TemporaryFolder;
public class BenchmarkEnvironment {
private final BenchmarkConfig config;
private final TemporaryFolder temp;
private final boolean isGolem;
public BenchmarkEnvironment(BenchmarkConfig config, TemporaryFolder temp, boolean isGolem) {
this.config = config;
this.temp = temp;
this.isGolem = isGolem;
}
public BenchmarkConfig getConfig() {
return config;
}
public TemporaryFolder getTemp() {
return temp;
}
public Path translateDependencyPath(String directoryName, Path location) {
return isGolem
? Paths.get("benchmarks", config.getDependencyDirectoryName(), directoryName)
: location.resolve(directoryName);
}
}