blob: de9b4029546088c75a44def476c5622d2b2f2ace [file] [log] [blame]
// Copyright (c) 2016, 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.internal;
import com.android.tools.r8.CompilationFailedException;
import com.android.tools.r8.CompilationMode;
import com.android.tools.r8.R8RunArtTestsTest.CompilerUnderTest;
import com.android.tools.r8.utils.InternalOptions;
import com.google.common.collect.ImmutableList;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.concurrent.ExecutionException;
import java.util.function.Consumer;
public abstract class GMSCoreCompilationTestBase extends CompilationTestBase {
public static final String GMSCORE_V4_DIR = "third_party/gmscore/v4/";
public static final String GMSCORE_V5_DIR = "third_party/gmscore/v5/";
public static final String GMSCORE_V6_DIR = "third_party/gmscore/v6/";
public static final String GMSCORE_V7_DIR = "third_party/gmscore/v7/";
public static final String GMSCORE_V8_DIR = "third_party/gmscore/v8/";
public static final String GMSCORE_V9_DIR = "third_party/gmscore/gmscore_v9/";
public static final String GMSCORE_V10_DIR = "third_party/gmscore/gmscore_v10/";
public static final String GMSCORE_LATEST_DIR = "third_party/gmscore/latest/";
public static final int GMSCORE_V9_MAX_SIZE = 35000000;
public static final int GMSCORE_V10_MAX_SIZE = 35000000;
public static final int GMSCORE_LATEST_MAX_SIZE = 35000000;
static final String GMSCORE_APK = "GMSCore.apk";
// Files pertaining to the full GMSCore build.
static final String PG_MAP = "GmsCore_prod_alldpi_release_all_locales_proguard.map";
static final String PG_CONF = "GmsCore_prod_alldpi_release_all_locales_proguard.config";
static final String DEPLOY_JAR = "GmsCore_prod_alldpi_release_all_locales_deploy.jar";
static final String REFERENCE_APK = "noshrink_x86_GmsCore_prod_alldpi_release_unsigned.apk";
public void runR8AndCheckVerification(CompilationMode mode, String version)
throws ExecutionException, IOException, CompilationFailedException {
runR8AndCheckVerification(mode, version, null);
}
public void runR8AndCheckVerification(
CompilationMode mode, String version, Consumer<InternalOptions> optionsConsumer)
throws ExecutionException, IOException, CompilationFailedException {
runAndCheckVerification(CompilerUnderTest.R8, mode, version, optionsConsumer);
}
private void runAndCheckVerification(
CompilerUnderTest compiler,
CompilationMode mode,
String version,
Consumer<InternalOptions> optionsConsumer)
throws ExecutionException, IOException, CompilationFailedException {
runAndCheckVerification(
compiler,
mode,
version + GMSCORE_APK,
null,
optionsConsumer,
ImmutableList.of(Paths.get(version, GMSCORE_APK).toString()));
}
}