Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8301143: [TESTBUG] jfr/event/sampling/TestNative was backported to JD…
…K8u without proper native wrapper Reviewed-by: sgehwolf, phh
- Loading branch information
Jiří Vaněk
authored and
Paul Hohensee
committed
Feb 16, 2023
1 parent
aed31d9
commit b3e2380
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
OS=`uname -s` | ||
if [ "${OS}" != "Linux" -a "${OS}" != "Darwin" ]; then | ||
echo "This is a Linux/MacOSX only test" | ||
exit 0; | ||
fi | ||
|
||
if [ "x$TESTGCC" = "x" ]; then | ||
TESTGCC=$(readlink -f $(which gcc)) | ||
fi | ||
|
||
if [ "x$TESTGCC" = "x" ]; then | ||
echo "WARNING: gcc not found. Cannot execute test." 2>&1 | ||
exit 1; | ||
fi | ||
|
||
if [ "x$TESTROOT" = "x" ]; then | ||
echo "TESTROOT pointintg to top level sources is not set. that is fatal" | ||
exit 2; | ||
fi | ||
|
||
if [ "x$TESTJAVA" = "x" ]; then | ||
TESTJAVA=$(dirname $(dirname $(readlink -f $(which java)))) | ||
fi | ||
|
||
JDK_TOPDIR="${TESTROOT}/.." | ||
JAVAC="${TESTJAVA}/bin/javac" | ||
JAVA="${TESTJAVA}/bin/java" | ||
TEST_ENV_SH="${JDK_TOPDIR}/../hotspot/test/test_env.sh" | ||
|
||
ls -l "${TEST_ENV_SH}" | ||
set +e | ||
source "${TEST_ENV_SH}" | ||
set -e | ||
|
||
"${TESTGCC}" \ | ||
-shared \ | ||
${CFLAGBITS} \ | ||
-o ${TESTCLASSES}/libTestNative.so \ | ||
-I${JDK_TOPDIR}/src/share/bin \ | ||
-I${JDK_TOPDIR}/src/share/javavm/export \ | ||
-I${JDK_TOPDIR}/src/macosx/javavm/export \ | ||
-I${JDK_TOPDIR}/src/solaris/bin \ | ||
${TESTSRC}/libTestNative.c | ||
|
||
"${JAVAC}" -d ${TESTCLASSES} \ | ||
${TESTROOT}/lib/jdk/test/lib/Utils.java \ | ||
${TESTROOT}/lib/jdk/test/lib/JDKToolLauncher.java \ | ||
${TESTROOT}/lib/jdk/test/lib/Platform.java \ | ||
${TESTROOT}/lib/jdk/test/lib/Asserts.java \ | ||
${TESTROOT}/lib/jdk/test/lib/jfr/EventNames.java \ | ||
${TESTROOT}/lib/jdk/test/lib/JDKToolFinder.java \ | ||
${TESTROOT}/lib/jdk/test/lib/process/*.java | ||
|
||
"${JAVAC}" -cp ${TESTCLASSPATH}:${TESTCLASSES} -d ${TESTCLASSES} ${TESTSRC}/TestNative.java | ||
|
||
"${JAVA}" -Dtest.jdk=${TESTJAVA} \ | ||
-Dtest.nativepath=${TESTCLASSES} \ | ||
-Djava.library.path=${TESTCLASSES} \ | ||
-cp ${TESTCLASSPATH}:${TESTCLASSES} jdk.jfr.event.sampling.TestNative |
b3e2380
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues