# HG changeset patch # User Stefan Anzinger # Date 1404923773 25200 # Node ID cb70055faeebcdecd95b3459ed7e83361083dffc # Parent 587ff693e666da8ed0a7e1750c3d23ecadbe7535 [SPARC/AMD64] Ignore AllocatorTest when the platform does not match. diff -r 587ff693e666 -r cb70055faeeb graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java --- a/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java Wed Jul 09 08:48:03 2014 -0700 +++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java Wed Jul 09 09:36:13 2014 -0700 @@ -26,8 +26,15 @@ import com.oracle.graal.compiler.test.backend.*; +import static org.junit.Assume.*; + public class AMD64AllocatorTest extends AllocatorTest { + @Before + public void setUp() { + assumeTrue(isArchitecture("AMD64")); + } + @Test public void test1() { test("test1snippet", 3, 1, 0); diff -r 587ff693e666 -r cb70055faeeb graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java --- a/graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java Wed Jul 09 08:48:03 2014 -0700 +++ b/graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java Wed Jul 09 09:36:13 2014 -0700 @@ -22,12 +22,19 @@ */ package com.oracle.graal.compiler.sparc.test; +import static org.junit.Assume.*; + import org.junit.*; import com.oracle.graal.compiler.test.backend.*; public class SPARCAllocatorTest extends AllocatorTest { + @Before + public void setUp() { + assumeTrue(isArchitecture("SPARC")); + } + @Test public void test1() { test("test1snippet", 1, 0, 0); diff -r 587ff693e666 -r cb70055faeeb graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Wed Jul 09 08:48:03 2014 -0700 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Wed Jul 09 09:36:13 2014 -0700 @@ -743,4 +743,15 @@ protected static boolean iterationCount(double i, boolean cond) { return cond; } + + /** + * Test if the current test runs on the given platform. The name must match the name given in + * the {@link Architecture#getName()}. + * + * @param name The name to test + * @return true if we run on the architecture given by name + */ + protected boolean isArchitecture(String name) { + return name.equals(backend.getTarget().arch.getName()); + } }