Skip to content

Commit 846fd23

Browse files
committed
8245610: remove in-tree copy on gtest
Reviewed-by: erikj, ihse
1 parent 5374383 commit 846fd23

File tree

91 files changed

+110
-57402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+110
-57402
lines changed

doc/building.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,11 @@ <h4 id="advanced-make-control-variables">Advanced Make Control Variables</h4>
495495
<h2 id="running-tests">Running Tests</h2>
496496
<p>Most of the JDK tests are using the <a href="http://openjdk.java.net/jtreg">JTReg</a> test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the <code>--with-jtreg=&lt;path to jtreg home&gt;</code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.</p>
497497
<p>The <a href="https://wiki.openjdk.java.net/display/Adoption">Adoption Group</a> provides recent builds of jtreg <a href="https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact">here</a>. Download the latest <code>.tar.gz</code> file, unpack it, and point <code>--with-jtreg</code> to the <code>jtreg</code> directory that you just unpacked.</p>
498+
<p>Building of Hotspot Gtest suite requires the source code of Google Test framework. The top directory, which contains both <code>googletest</code> and <code>googlemock</code> directories, should be specified via <code>--with-gtest</code>. The supported version of Google Test is 1.8.1, whose source code can be obtained:</p>
499+
<ul>
500+
<li>by downloading and unpacking the source bundle from <a href="https://github.com/google/googletest/releases/tag/release-1.8.1">here</a></li>
501+
<li>or by checking out <code>release-1.8.1</code> tag of <code>googletest</code> project: <code>git clone -b release-1.8.1 https://github.com/google/googletest</code></li>
502+
</ul>
498503
<p>To execute the most basic tests (tier 1), use:</p>
499504
<pre><code>make run-test-tier1</code></pre>
500505
<p>For more details on how to run tests, please see the <a href="testing.html">Testing the JDK</a> document.</p>

doc/building.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,14 @@ https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/arti
829829
Download the latest `.tar.gz` file, unpack it, and point `--with-jtreg` to the
830830
`jtreg` directory that you just unpacked.
831831
832+
Building of Hotspot Gtest suite requires the source code of Google Test framework.
833+
The top directory, which contains both `googletest` and `googlemock`
834+
directories, should be specified via `--with-gtest`.
835+
The supported version of Google Test is 1.8.1, whose source code can be obtained:
836+
837+
* by downloading and unpacking the source bundle from [here](https://github.com/google/googletest/releases/tag/release-1.8.1)
838+
* or by checking out `release-1.8.1` tag of `googletest` project: `git clone -b release-1.8.1 https://github.com/google/googletest`
839+
832840
To execute the most basic tests (tier 1), use:
833841
```
834842
make run-test-tier1

make/Main.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ $(eval $(call SetupTarget, test-image-hotspot-jtreg-graal, \
652652
DEPS := build-test-hotspot-jtreg-graal, \
653653
))
654654

655-
ifeq ($(BUILD_GTEST), true)
655+
ifneq ($GTEST_FRAMEWORK_SRC), )
656656
$(eval $(call SetupTarget, test-image-hotspot-gtest, \
657657
MAKEFILE := hotspot/test/GtestImage, \
658658
DEPS := hotspot, \
@@ -1109,7 +1109,7 @@ ifneq ($(JVM_TEST_IMAGE_TARGETS), )
11091109
test-image: $(JVM_TEST_IMAGE_TARGETS)
11101110
else
11111111
test-image: test-image-hotspot-jtreg-native
1112-
ifeq ($(BUILD_GTEST), true)
1112+
ifneq ($(GTEST_FRAMEWORK_SRC), )
11131113
test-image: test-image-hotspot-gtest
11141114
endif
11151115

make/RunTestsPrebuiltSpec.gmk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ SHELL := $(BASH) $(BASH_ARGS)
8282
# Set some reasonable defaults for features
8383
DEBUG_LEVEL := release
8484
HOTSPOT_DEBUG_LEVEL := release
85-
BUILD_GTEST := true
8685
BUILD_FAILURE_HANDLER := true
8786

8887
################################################################################

make/autoconf/buildjdk-spec.gmk.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ DISABLE_WARNING_PREFIX := @BUILD_CC_DISABLE_WARNING_PREFIX@
9191
# Save speed and disk space by not enabling debug symbols for the buildjdk
9292
ENABLE_DEBUG_SYMBOLS := false
9393

94-
# Control whether Hotspot builds gtest tests
95-
BUILD_GTEST := false
96-
9794
JVM_VARIANTS := server
9895
JVM_VARIANT_MAIN := server
9996
JVM_FEATURES_server := cds compiler1 compiler2 g1gc serialgc

make/autoconf/configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ LIB_SETUP_LIBRARIES
234234
JVM_FEATURES_PARSE_OPTIONS
235235
JVM_FEATURES_SETUP
236236

237-
HOTSPOT_ENABLE_DISABLE_GTEST
238237
HOTSPOT_SETUP_MISC
239238

240239
###############################################################################

make/autoconf/hotspot.m4

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -111,28 +111,6 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
111111
AC_SUBST(JVM_VARIANT_MAIN)
112112
])
113113

114-
###############################################################################
115-
# Check if gtest should be built
116-
#
117-
AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
118-
[
119-
GTEST_AVAILABLE=true
120-
121-
AC_MSG_CHECKING([if Hotspot gtest test source is present])
122-
if test -e "${TOPDIR}/test/hotspot/gtest"; then
123-
AC_MSG_RESULT([yes])
124-
else
125-
AC_MSG_RESULT([no, cannot build gtest])
126-
GTEST_AVAILABLE=false
127-
fi
128-
129-
UTIL_ARG_ENABLE(NAME: hotspot-gtest, DEFAULT: auto,
130-
RESULT: BUILD_GTEST, AVAILABLE: $GTEST_AVAILABLE,
131-
DEFAULT_DESC: [enabled if possible to build],
132-
DESC: [enable building of the Hotspot unit tests])
133-
AC_SUBST(BUILD_GTEST)
134-
])
135-
136114
###############################################################################
137115
# Misc hotspot setup that does not fit elsewhere.
138116
#
@@ -162,4 +140,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
162140
163141
# --with-cpu-port is no longer supported
164142
UTIL_DEPRECATED_ARG_WITH(with-cpu-port)
143+
144+
# in jdk15 hotspot-gtest was replaced with --with-gtest
145+
UTIL_DEPRECATED_ARG_ENABLE(hotspot-gtest)
165146
])

make/autoconf/lib-tests.m4

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,39 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GRAALUNIT],
5555
AC_SUBST(GRAALUNIT_LIB)
5656
])
5757

58+
###############################################################################
59+
#
60+
# Setup and check for gtest framework source files
61+
#
62+
AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST],
63+
[
64+
AC_ARG_WITH(gtest, [AS_HELP_STRING([--with-gtest],
65+
[specify prefix directory for the gtest framework])])
66+
67+
if test "x${with_gtest}" != x; then
68+
AC_MSG_CHECKING([for gtest])
69+
if test "x${with_gtest}" = xno; then
70+
AC_MSG_RESULT([no, disabled])
71+
elif test "x${with_gtest}" = xyes; then
72+
AC_MSG_RESULT([no, error])
73+
AC_MSG_ERROR([--with-gtest must have a value])
74+
else
75+
if ! test -s "${with_gtest}/googletest/include/gtest/gtest.h"; then
76+
AC_MSG_RESULT([no])
77+
AC_MSG_ERROR([Can't find 'googletest/include/gtest/gtest.h' under ${with_gtest} given with the --with-gtest option.])
78+
elif ! test -s "${with_gtest}/googlemock/include/gmock/gmock.h"; then
79+
AC_MSG_RESULT([no])
80+
AC_MSG_ERROR([Can't find 'googlemock/include/gmock/gmock.h' under ${with_gtest} given with the --with-gtest option.])
81+
else
82+
GTEST_FRAMEWORK_SRC=${with_gtest}
83+
AC_MSG_RESULT([$GTEST_FRAMEWORK_SRC])
84+
fi
85+
fi
86+
fi
87+
88+
AC_SUBST(GTEST_FRAMEWORK_SRC)
89+
])
90+
5891
###############################################################################
5992
#
6093
# Setup and check the Java Microbenchmark Harness

make/autoconf/libraries.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
102102
LIB_SETUP_BUNDLED_LIBS
103103
LIB_SETUP_MISC_LIBS
104104
LIB_TESTS_SETUP_GRAALUNIT
105+
LIB_TESTS_SETUP_GTEST
105106
106107
BASIC_JDKLIB_LIBS=""
107108
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then

make/autoconf/spec.gmk.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,6 @@ JVM_FEATURES_custom := @JVM_FEATURES_custom@
292292
VALID_JVM_FEATURES := @VALID_JVM_FEATURES@
293293
VALID_JVM_VARIANTS := @VALID_JVM_VARIANTS@
294294

295-
# Control whether Hotspot builds gtest tests
296-
BUILD_GTEST := @BUILD_GTEST@
297-
298295
# Allow overriding the default hotspot library path
299296
HOTSPOT_OVERRIDE_LIBPATH := @HOTSPOT_OVERRIDE_LIBPATH@
300297

@@ -392,6 +389,8 @@ JMH_JOPT_SIMPLE_JAR := @JMH_JOPT_SIMPLE_JAR@
392389
JMH_COMMONS_MATH_JAR := @JMH_COMMONS_MATH_JAR@
393390
JMH_VERSION := @JMH_VERSION@
394391

392+
GTEST_FRAMEWORK_SRC := @GTEST_FRAMEWORK_SRC@
393+
395394
# Source file for cacerts
396395
CACERTS_FILE=@CACERTS_FILE@
397396

0 commit comments

Comments
 (0)