# HG changeset patch # User dpochepk # Date 1464182551 -10800 # Node ID 6bc0837b2633db77679a37a4b1ef59dc61e204c8 # Parent 462b3dc4ab278aa49a977d21974c40eb2b11c2bf 8156470: [JITtester] EOL on Windows Reviewed-by: kvn diff -r 462b3dc4ab27 -r 6bc0837b2633 hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java Wed May 25 16:20:02 2016 +0300 +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java Wed May 25 16:22:31 2016 +0300 @@ -33,6 +33,7 @@ import java.nio.file.Paths; import java.util.Arrays; import java.util.function.Predicate; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -52,14 +53,16 @@ throw new Error("Unexpected exception on test jvm start :" + e, e); } + Pattern splitOut = Pattern.compile("\\n"); // tests use \n only in stdout + Pattern splitErr = Pattern.compile("\\r?\\n"); // can handle both \r\n and \n Path testDir = Paths.get(Utils.TEST_SRC); String goldOut = formatOutput(streamGoldFile(testDir, args[0], "out"), s -> true); - Asserts.assertEQ(oa.getStdout(), goldOut, "Actual stdout isn't equal to golden one"); - + String anlzOut = formatOutput(Arrays.stream(splitOut.split(oa.getStdout())), s -> true); + Asserts.assertEQ(anlzOut, goldOut, "Actual stdout isn't equal to golden one"); // TODO: add a comment why we skip such lines Predicate notStartWhitespaces = s -> !(s.startsWith("\t") || s.startsWith(" ")); String goldErr = formatOutput(streamGoldFile(testDir, args[0], "err"), notStartWhitespaces); - String anlzErr = formatOutput(Arrays.stream(oa.getStderr().split(Utils.NEW_LINE)), + String anlzErr = formatOutput(Arrays.stream(splitErr.split(oa.getStderr())), notStartWhitespaces); Asserts.assertEQ(anlzErr, goldErr, "Actual stderr isn't equal to golden one"); diff -r 462b3dc4ab27 -r 6bc0837b2633 hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/utils/FixedTrees.java --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/utils/FixedTrees.java Wed May 25 16:20:02 2016 +0300 +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/utils/FixedTrees.java Wed May 25 16:22:31 2016 +0300 @@ -37,7 +37,6 @@ import jdk.test.lib.jittester.Operator; import jdk.test.lib.jittester.OperatorKind; import jdk.test.lib.jittester.PrintVariables; -import jdk.test.lib.jittester.ProductionFailedException; import jdk.test.lib.jittester.Statement; import jdk.test.lib.jittester.StaticMemberVariable; import jdk.test.lib.jittester.Symbol; @@ -171,22 +170,22 @@ TryCatchBlock tryCatch1 = new TryCatchBlock(tryNode, nothing, catchBlocks1, 3); TypeKlass printStreamKlass = new TypeKlass("java.io.PrintStream"); TypeKlass systemKlass = new TypeKlass("java.lang.System"); - FunctionInfo systemOutPrintlnInfo = new FunctionInfo("println", printStreamKlass, + FunctionInfo systemOutPrintInfo = new FunctionInfo("print", printStreamKlass, TypeList.VOID, 0, FunctionInfo.PUBLIC, new VariableInfo("this", owner, printStreamKlass, VariableInfo.LOCAL | VariableInfo.INITIALIZED), new VariableInfo("t", owner, TypeList.OBJECT, VariableInfo.LOCAL | VariableInfo.INITIALIZED)); - List printlnArgs = new ArrayList<>(); + List printArgs = new ArrayList<>(); VariableInfo systemOutInfo = new VariableInfo("out", systemKlass, printStreamKlass, VariableInfo.STATIC | VariableInfo.PUBLIC); StaticMemberVariable systemOutVar = new StaticMemberVariable(owner, systemOutInfo); - printlnArgs.add(systemOutVar); - printlnArgs.add(tVar); - Function println = new Function(printStreamKlass, systemOutPrintlnInfo, printlnArgs); - ArrayList printlnBlockContent = new ArrayList<>(); - printlnBlockContent.add(new Statement(println, true)); - Block printlnBlock = new Block(owner, TypeList.VOID, printlnBlockContent, 3); - TryCatchBlock tryCatch2 = new TryCatchBlock(printlnBlock, nothing, catchBlocks2, 3); + printArgs.add(systemOutVar); + printArgs.add(tVar); + Function print = new Function(printStreamKlass, systemOutPrintInfo, printArgs); + ArrayList printBlockContent = new ArrayList<>(); + printBlockContent.add(new Statement(print, true)); + Block printBlock = new Block(owner, TypeList.VOID, printBlockContent, 3); + TryCatchBlock tryCatch2 = new TryCatchBlock(printBlock, nothing, catchBlocks2, 3); List mainTryCatchBlockContent = new ArrayList<>(); mainTryCatchBlockContent.add(new Statement(testInit, true));