# HG changeset patch # User Doug Simon # Date 1415895908 -3600 # Node ID cb3c93857cbb20c035048a204b443674de96ccb8 # Parent 23526af9360df556487ed0037f56f957883f5688 made compilation replay testing less strict by default diff -r 23526af9360d -r cb3c93857cbb 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 Thu Nov 13 16:53:30 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Thu Nov 13 17:25:08 2014 +0100 @@ -676,15 +676,18 @@ } /** - * Determines if every compilation should also be attempted in a replay {@link Context}. - * - *
-     * -Dgraal.testReplay=true
-     * 
+ * Determines if {@linkplain #compile(ResolvedJavaMethod, StructuredGraph) compilation} should + * also be attempted in a replay {@link Context} where possible. */ private static final boolean TEST_REPLAY = Boolean.getBoolean("graal.testReplay"); /** + * Determines if a {@link #checkCompilationResultsEqual mismatching} replay compilation result + * results in a diagnostic message or a test error. + */ + private static final boolean TEST_REPLAY_MISMATCH_IS_FAILURE = Boolean.getBoolean("graal.testReplay.strict"); + + /** * Directory into which tests can dump content useful in debugging test failures. */ private static final File OUTPUT_DIR = new File(System.getProperty("graal.test.output"), "testOutput"); @@ -710,7 +713,7 @@ } } - protected void assertCompilationResultsEqual(Context c, String prefix, CompilationResult original, CompilationResult derived, ResolvedJavaMethod installedCodeOwner) { + protected void checkCompilationResultsEqual(Context c, String prefix, CompilationResult original, CompilationResult derived, ResolvedJavaMethod installedCodeOwner) { if (!derived.equals(original)) { Mode mode = c.getMode(); // Temporarily force capturing mode as dumping/printing/disassembling @@ -723,7 +726,11 @@ if (originalDisFile != null && derivedDisFile != null) { message += String.format(" [diff %s %s]", originalDisFile, derivedDisFile); } - Assert.fail(message); + if (TEST_REPLAY_MISMATCH_IS_FAILURE) { + Assert.fail(message); + } else { + System.out.println(message); + } } finally { c.setMode(mode); } @@ -740,7 +747,7 @@ Request request = c.get(new GraalCompiler.Request<>(graphToCompile, null, cc, installedCodeOwner, getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, getProfilingInfo(graphToCompile), getSpeculationLog(), getSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default)); - assertCompilationResultsEqual(c, mode.name(), originalResultInContext, GraalCompiler.compile(request), installedCodeOwner); + checkCompilationResultsEqual(c, mode.name(), originalResultInContext, GraalCompiler.compile(request), installedCodeOwner); } catch (Throwable e) { throw Debug.handle(e); }