8218460: Test generation scripts do not invoke stream preprocessor correctly
authorbpb
Tue, 05 Feb 2019 14:36:50 -0800
changeset 53648 6d37b8ec36fa
parent 53647 82c95d4b61f0
child 53649 0b959dfdf0d9
8218460: Test generation scripts do not invoke stream preprocessor correctly Reviewed-by: rriggs
make/jdk/src/classes/build/tools/spp/Spp.java
test/jdk/java/lang/invoke/VarHandles/generate-vh-tests.sh
test/jdk/java/nio/Buffer/genBasic.sh
test/jdk/java/nio/Buffer/genCopyDirectMemory.sh
test/jdk/java/nio/Buffer/genOrder.sh
test/jdk/java/util/Formatter/genBasic.sh
--- 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 ... <in >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.
--- 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
--- 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-X.java.template >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
--- 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=$3<CopyDirect-X-Memory.java.template >CopyDirect$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
--- 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=$3<Order-X.java.template >Order$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
--- 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 -Kprim<Basic-X.java.template >Basic$2.java
 #  else $SPP -K$1 -Dtype=$1 -DType=$2 -K$3 <Basic-X.java.template >Basic$2.java
 #  fi
-    java build.tools.spp.Spp -K$1 -Dtype=$1 -DType=$2 -K$3 -K$4 -K$5 -K$6 <Basic-X.java.template >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  ""  ""   ""