1 #!/bin/bash
 2 #
 3 # Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 5 #
 6 # This code is free software; you can redistribute it and/or modify it
 7 # under the terms of the GNU General Public License version 2 only, as
 8 # published by the Free Software Foundation.
 9 #
10 # This code is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13 # version 2 for more details (a copy is included in the LICENSE file that
14 # accompanied this code).
15 #
16 # You should have received a copy of the GNU General Public License version
17 # 2 along with this work; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 #
20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 # or visit www.oracle.com if you need additional information or have any
22 # questions.
23 #
24 
25 JDK_SRC_HOME="$(git rev-parse --show-toplevel)"
26 VECTORTESTS_HOME="$JDK_SRC_HOME/test/jdk/jdk/incubator/vector/"
27 JAVA="${JAVA_HOME}/bin/java"
28 JAVAC="${JAVA_HOME}/bin/javac"
29 BUILDLOG_FILE="./build.log"
30 SPP_CLASSNAME="build.tools.spp.Spp"
31 # Windows: Classpath Separator is ';'
32 # Linux: ':'
33 SEPARATOR=":"
34 TYPEPREFIX=""
35 TEMPLATE_FILE="unit_tests.template"
36 TESTNG_JAR="${TESTNG_PLUGIN}/plugins/org.testng.source_6.13.1.r201712040515.jar"
37 TESTNG_RUN_JAR="${TESTNG_PLUGIN}/plugins/org.testng_6.13.1.r201712040515.jar"
38 JCOMMANDER_JAR="${TESTNG_PLUGIN}/plugins/com.beust.jcommander_1.72.0.jar"
39 TEST_ITER_COUNT=100
40 
41 PERF_TEMPLATE_FILE="perf_tests.template"
42 PERF_SCALAR_TEMPLATE_FILE="perf_scalar_tests.template"
43 PERF_DEST="$JDK_SRC_HOME/test/micro/org/openjdk/bench/jdk/incubator/vector/operation"
44 
45 
46 function Log () {
47   if [ $1 == true ]; then
48     echo "$2"
49   fi
50   echo "$2" >> $BUILDLOG_FILE
51 }
52 
53 function LogRun () {
54   if [ $1 == true ]; then
55     echo -ne "$2"
56   fi
57   echo -ne "$2" >> $BUILDLOG_FILE
58 }
59 
60 # Determine which delimiter to use based on the OS.
61 # Windows uses ";", while Unix-based OSes use ":"
62 uname_s=$(uname -s)
63 VECTORTESTS_HOME_CP=$VECTORTESTS_HOME
64 if [ "x${VAR_OS_ENV}" == "xwindows.cygwin" ]; then
65   VECTORTESTS_HOME_CP=$(cygpath -pw $VECTORTESTS_HOME)
66 fi
67 
68 if [ "$uname_s" == "Linux" ] || [ "$uname_s" == "Darwin" ]; then
69   SEPARATOR=":"
70 else
71   SEPARATOR=";"
72 fi