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