# HG changeset patch # User bpb # Date 1549406210 28800 # Node ID 6d37b8ec36faf0fbc56e0c85af634b1b36279479 # Parent 82c95d4b61f08a5bc5f9374ba0783733acbaa5d1 8218460: Test generation scripts do not invoke stream preprocessor correctly Reviewed-by: rriggs diff -r 82c95d4b61f0 -r 6d37b8ec36fa make/jdk/src/classes/build/tools/spp/Spp.java --- a/make/jdk/src/classes/build/tools/spp/Spp.java Tue Feb 05 16:46:49 2019 -0500 +++ b/make/jdk/src/classes/build/tools/spp/Spp.java Tue Feb 05 14:36:50 2019 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,8 @@ * Spp: A simple regex-based stream preprocessor based on Mark Reinhold's * sed-based spp.sh * - * Usage: java build.tools.spp.Spp [-be] [-nel] [-Kkey] -Dvar=value ... out + * Usage: + * java build.tools.spp.Spp [-be] [-nel] [-Kkey] -Dvar=value ... -iin -oout * * If -nel is declared then empty lines will not be substituted for lines of * text in the template that do not appear in the output. diff -r 82c95d4b61f0 -r 6d37b8ec36fa test/jdk/java/lang/invoke/VarHandles/generate-vh-tests.sh --- a/test/jdk/java/lang/invoke/VarHandles/generate-vh-tests.sh Tue Feb 05 16:46:49 2019 -0500 +++ b/test/jdk/java/lang/invoke/VarHandles/generate-vh-tests.sh Tue Feb 05 14:36:50 2019 -0800 @@ -82,9 +82,15 @@ args="$args -Dvalue1=$value1 -Dvalue2=$value2 -Dvalue3=$value3 -Dwrong_primitive_type=$wrong_primitive_type" echo $args - java $SPP -nel $args < X-VarHandleTestAccess.java.template > VarHandleTestAccess${Type}.java - java $SPP -nel $args < X-VarHandleTestMethodHandleAccess.java.template > VarHandleTestMethodHandleAccess${Type}.java - java $SPP -nel $args < X-VarHandleTestMethodType.java.template > VarHandleTestMethodType${Type}.java + out=VarHandleTestAccess${Type}.java + rm -f $out + java $SPP -nel $args -iX-VarHandleTestAccess.java.template -o$out + out=VarHandleTestMethodHandleAccess${Type}.java + rm -f $out + java $SPP -nel $args -iX-VarHandleTestMethodHandleAccess.java.template -o$out + out=VarHandleTestMethodType${Type}.java + rm -f $out + java $SPP -nel $args -iX-VarHandleTestMethodType.java.template -o$out done for type in short char int long float double @@ -161,7 +167,9 @@ args="$args -Dvalue1=$value1 -Dvalue2=$value2 -Dvalue3=$value3" echo $args - java $SPP -nel $args < X-VarHandleTestByteArrayView.java.template > VarHandleTestByteArrayAs${Type}.java + out=VarHandleTestByteArrayAs${Type}.java + rm -f $out + java $SPP -nel $args -iX-VarHandleTestByteArrayView.java.template -o$out done rm -fr build diff -r 82c95d4b61f0 -r 6d37b8ec36fa test/jdk/java/nio/Buffer/genBasic.sh --- a/test/jdk/java/nio/Buffer/genBasic.sh Tue Feb 05 16:46:49 2019 -0500 +++ b/test/jdk/java/nio/Buffer/genBasic.sh Tue Feb 05 14:36:50 2019 -0800 @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,9 @@ javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java gen() { - java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3 Basic$2.java + out=Basic$2.java + rm -f $out + java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3 -iBasic-X.java.template -o$out } gen byte Byte Byte diff -r 82c95d4b61f0 -r 6d37b8ec36fa test/jdk/java/nio/Buffer/genCopyDirectMemory.sh --- a/test/jdk/java/nio/Buffer/genCopyDirectMemory.sh Tue Feb 05 16:46:49 2019 -0500 +++ b/test/jdk/java/nio/Buffer/genCopyDirectMemory.sh Tue Feb 05 14:36:50 2019 -0800 @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,12 @@ # questions. # -javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java > Spp.java +javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java gen() { - java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3CopyDirect$2Memory.java + out=CopyDirect$2Memory.java + rm -f $out + java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3 -iCopyDirect-X-Memory.java.template -o$out } gen byte Byte Byte diff -r 82c95d4b61f0 -r 6d37b8ec36fa test/jdk/java/nio/Buffer/genOrder.sh --- a/test/jdk/java/nio/Buffer/genOrder.sh Tue Feb 05 16:46:49 2019 -0500 +++ b/test/jdk/java/nio/Buffer/genOrder.sh Tue Feb 05 14:36:50 2019 -0800 @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,9 +23,11 @@ # questions. # -javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java > Spp.java +javac -d . ../../../../../make/jdk/src/classes/build/tools/spp/Spp.java gen() { - java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3Order$2.java + out=Order$2.java + rm -f $out + java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -DFulltype=$3 -iOrder-X.java.template -o$out } gen char Char Character diff -r 82c95d4b61f0 -r 6d37b8ec36fa test/jdk/java/util/Formatter/genBasic.sh --- a/test/jdk/java/util/Formatter/genBasic.sh Tue Feb 05 16:46:49 2019 -0500 +++ b/test/jdk/java/util/Formatter/genBasic.sh Tue Feb 05 14:36:50 2019 -0800 @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,9 @@ # then $SPP -K$1 -Dtype=$1 -DType=$2 -KprimBasic$2.java # else $SPP -K$1 -Dtype=$1 -DType=$2 -K$3 Basic$2.java # fi - java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -K$3 -K$4 -K$5 -K$6 Basic$2.java + out=Basic$2.java + rm -f $out + java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -K$3 -K$4 -K$5 -K$6 -iBasic-X.java.template -o$out } gen boolean Boolean prim "" "" ""