blob: 1f9eca9dc3e3bdbfb21bbf1137c133b8639a9932 [file] [log] [blame]
// Copyright (c) 2019, 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.debug;
import com.android.tools.r8.ToolHelper;
import com.android.tools.r8.ToolHelper.DexVm;
import com.android.tools.r8.ToolHelper.DexVm.Version;
import com.android.tools.r8.VmTestRunner;
import com.android.tools.r8.VmTestRunner.IgnoreIfVmOlderOrEqualThan;
import com.android.tools.r8.debug.DebugTestBase.JUnit3Wrapper.DebuggeeState;
import java.util.stream.Stream;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(VmTestRunner.class)
public class ThrowNPETestRunner extends DebugTestBase {
private static final Class CLASS = ThrowNPETest.class;
private static final String NAME = CLASS.getCanonicalName();
@Test
@IgnoreIfVmOlderOrEqualThan(Version.V5_1_1)
public void test() throws Exception {
// TODO(b/199700280): Reenable on 12.0.0 when we have the libjdwp.so file include and the flags
// fixed.
Assume.assumeTrue(
"Skipping test " + testName.getMethodName() + " because debugging not enabled in 12.0.0",
!ToolHelper.getDexVm().isEqualTo(DexVm.ART_12_0_0_HOST));
Assume.assumeTrue("Older runtimes cause some kind of debug streaming issues",
ToolHelper.getDexVm().isNewerThan(DexVm.ART_5_1_1_HOST));
DebugTestConfig cfConfig = new CfDebugTestConfig().addPaths(ToolHelper.getClassPathForTests());
DebugTestConfig d8Config = new D8DebugTestConfig().compileAndAddClasses(temp, CLASS);
new DebugStreamComparator()
.add("CF", createStream(cfConfig))
.add("D8", createStream(d8Config))
.compare();
}
private Stream<DebuggeeState> createStream(DebugTestConfig config) throws Exception {
return streamDebugTest(config, NAME, ANDROID_FILTER);
}
}