Skip to content

Commit

Permalink
8292716: Configure should check that jtreg is of the required version
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed Aug 23, 2022
1 parent b4e1aa8 commit 486f90c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions make/autoconf/lib-tests.m4
Expand Up @@ -27,6 +27,9 @@
# Setup libraries and functionalities needed to test the JDK.
################################################################################

# Minimum supported version
JTREG_MINIMUM_VERSION=6.1

###############################################################################
#
# Setup and check for gtest framework source files
Expand Down Expand Up @@ -213,6 +216,22 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG],
UTIL_FIXUP_PATH(JT_HOME)
AC_SUBST(JT_HOME)
# Verify jtreg version
AC_MSG_CHECKING([jtreg version number])
# jtreg -version looks like this: "jtreg 6.1+1-19"
# Extract actual version part ("6.1" in this case)
jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
jtreg_version=${jtreg_version_full/%+*}
AC_MSG_RESULT([$jtreg_version])
# This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION
comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"`
comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"`
if test $comparable_actual_version -lt $comparable_minimum_version ; then
AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required])
fi
])

# Setup the JIB dependency resolver
Expand Down

1 comment on commit 486f90c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.