Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adoptium/openj9-systemtest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.2
Choose a base ref
...
head repository: adoptium/openj9-systemtest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 12 commits
  • 6 files changed
  • 6 contributors

Commits on Jun 13, 2024

  1. Store SharedClasses classes jars in jdkversion dir

     - Add the classes jars for SharedClassesTest data into specific jdk version dir.
     - Updated copyright to 2016, 2024.
    
    related:eclipse-openj9/openj9#19582
    
     Signed-off-by: Anna Babu Palathingal <anna.bp@ibm.com>
    annaibm committed Jun 13, 2024
    Copy the full SHA
    f685fc1 View commit details
  2. Merge pull request #156 from annaibm/system_test_jdkdir

    Add classes.jar for sharedClassesTestData into specific jdk version dir.
    pshipton authored Jun 13, 2024
    Copy the full SHA
    ce686f5 View commit details

Commits on Oct 1, 2024

  1. Copy the full SHA
    d2e6e1e View commit details

Commits on Oct 2, 2024

  1. Correct shared library suffix on macOS

    Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
    keithc-ca committed Oct 2, 2024
    Copy the full SHA
    5d6ff1e View commit details
  2. Merge pull request #158 from keithc-ca/dylib

    Correct shared library suffix on macOS
    karianna authored Oct 2, 2024
    Copy the full SHA
    826f1fb View commit details
  3. Copy the full SHA
    7397082 View commit details
  4. Merge pull request #159 from adoptium/revert-158-dylib

    Revert "Correct shared library suffix on macOS"
    pshipton authored Oct 2, 2024
    Copy the full SHA
    087d63c View commit details
  5. Merge pull request #160 from LongyuZhang/revert40

    Revert "Temporarily exclude native sharedClasses tests on Windows"
    llxia authored Oct 2, 2024
    Copy the full SHA
    6913ab0 View commit details
  6. Correct shared library suffix on macOS

    Other fixes/improvements to makefile:
    * don't declare as .PHONY those targets that must exist
    * lines outside of scripts must not start with a tab
    * fix typos, punctuation
    
    Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
    keithc-ca committed Oct 2, 2024
    Copy the full SHA
    748831f View commit details
  7. Merge pull request #161 from keithc-ca/dylib

    Correct shared library suffix on macOS
    pshipton authored Oct 2, 2024
    Copy the full SHA
    4a96cb9 View commit details

Commits on Dec 4, 2024

  1. Handle missing classes.jar in sharedClassesTestData

    - ensure the presence of classes.jar , if doesnt exist regenerate it.
    
    resolves: eclipse-openj9/openj9#19582
    
    Signed-off-by: Anna Babu Palathingal <anna.bp@ibm.com>
    annaibm committed Dec 4, 2024
    Copy the full SHA
    a0c6914 View commit details

Commits on Dec 5, 2024

  1. Merge pull request #162 from annaibm/sharedClassCheck

    Handle missing classes.jar in sharedClassesTestData
    karianna authored Dec 5, 2024
    Copy the full SHA
    e4b27b7 View commit details
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2017, 2023 IBM Corp. and others
# Copyright (c) 2017, 2024 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
@@ -27,6 +27,7 @@
*.dict binary
*.dll binary
*.doc binary
*.dylib binary
*.ear binary
*.exe binary
*.gif binary
3 changes: 2 additions & 1 deletion .gitattributes.zos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#################################################################################
# Copyright (c) 2017, 2023 IBM Corp.
# Copyright (c) 2017, 2024 IBM Corp.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which accompanies this distribution
@@ -41,6 +41,7 @@
*.dict binary
*.dll binary
*.doc binary
*.dylib binary
*.ear binary
*.exe binary
*.gif binary
5 changes: 0 additions & 5 deletions openj9.test.sharedClasses.jvmti/build.xml
Original file line number Diff line number Diff line change
@@ -71,13 +71,8 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<target name="build-no-natives" depends="check-prereqs, build-dependencies, check-prereqs, build-archives">
</target>

<!--Temporarily excluding the native tests from building on Windows
due to : https://github.com/eclipse-openj9/openj9-systemtest/issues/38 -->
<target name="build-natives" depends="check-prereqs, setup-native-build-command, build-natives-windows, build-natives-unix">
</target>

<!-- <target name="build-natives" depends="check-prereqs, setup-native-build-command, build-natives-unix">
</target> -->

<target name="setup-native-build-command">
<echo message="building natives for java-platform ${java_platform}"/>
65 changes: 31 additions & 34 deletions openj9.test.sharedClasses.jvmti/src/native/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#################################################################################
# Copyright (c) 2017, 2023 IBM Corp.
# Copyright (c) 2017, 2024 IBM Corp.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which accompanies this distribution
# and is available at http://eclipse.org/legal/epl-2.0 or the Apache License,
# Version 2.0 which accompanies this distribution and is available at
# and is available at http://eclipse.org/legal/epl-2.0 or the Apache License,
# Version 2.0 which accompanies this distribution and is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the
# Licenses when the conditions for such availability set forth in the
# Eclipse Public License, v. 2.0 are satisfied: GNU General Public License,
# version 2 with the GNU Classpath Exception [1] and GNU General Public License,
# version 2 with the OpenJDK Assembly Exception [2].
@@ -21,25 +21,24 @@

#
# Usage: gmake [target] [OUTDIR=destdir] [JAVA_HOME=javadir] [SRCDIR=srcdir]
# target - The make target valid values for this makefile are build and clean
# target - The make target valid values for this makefile are build and clean.
# If no target is supplied the build target is used.
# platform - The platform to build for. The valid values for this argument are
# aix_ppc-32, aix_ppc-64, linux_390-32, linux_390-64, linux_ppc-32
# linux_ppc-64, linux_x86-32, linux_x86-64, win_x86-32, win_x86-64
# zos_390-32, zos_390-64,osx_x86-64
# outdir - The directory where a platform directory will be created and the lib will be place
# javadir - The java.home property directory (ie c:\sdk\jre)
# srcdir - Where the source files are located
# zos_390-32, zos_390-64, osx_x86-64.
# outdir - The directory where a platform directory will be created and the lib will be placed.
# javadir - The java.home property directory (ie c:\sdk\jre).
# srcdir - Where the source files are located.
#

# Assign OUTDIR, JAVA_HOME and SRCDIR to temporary variables so we can change to forward slashes or backslashes
# as required on Windows.
# We can't change the variables directly because they may be supplied on the command line and changes in makefiles
# would therefore be ignored.


###
# Figure out current platform
# Figure out current platform.
###
OS:=$(shell uname -s | tr "[:upper:]" "[:lower:]")

@@ -65,30 +64,30 @@ D=/
P=:

ifneq (,$(findstring cygwin,$(OS)))
OS:=win
OS:=win
endif

ifneq (,$(findstring darwin,$(OS)))
OS:=osx
OS:=osx
endif

ifeq ($(OS),os/390)
OS:=zos
endif
OS:=zos
endif

ifneq (,$(findstring win,$(OS)))
OS:=win
OS:=win
endif

$(info OS is $(OS))

DESTDIR=$(OUTDIR)/$(OS)
OBJDIR=$(OUTDIR)/$(OS)

# AIX requires bitmode value to be passed into compilar flags
# AIX requires bitmode value to be passed into compiler flags.
ifeq ($(OS),aix)
BitMode:=$(shell getconf KERNEL_BITMODE)
endif
BitMode:=$(shell getconf KERNEL_BITMODE)
endif

CFLAGS:=-D_JNI_IMPLEMENTATION_ -D_TRIVIAL_AGENT -O0 -g3 -pedantic -c -Wall -std=c99 -fPIC -fno-omit-frame-pointer -static-libgcc -o $(OBJDIR)/sharedClasses$(OSUFFIX)
LFLAGS:=-shared $(LFLAGS) -o
@@ -106,16 +105,17 @@ ifeq ($(OS),aix)
CC=xlC
LD=xlC
CFLAGS=-D_JNI_IMPLEMENTATION -D_TRIVIAL_AGENT -qnooptimize -g -qlanglvl=stdc99 -q$(BitMode) -c -o $(OBJDIR)/sharedClasses$(OSUFFIX)
LFLAGS=-G -q$(BitMode) -o
LFLAGS=-G -q$(BitMode) -o
IFLAGS=-I. -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/aix -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/aix -I/usr/include
endif

ifeq ($(OS),osx)
SUFFIX=.dylib
CFLAGS=-fPIC -fno-omit-frame-pointer -O0 -g3 -pedantic -Wall -std=c99 -c -D_JNI_IMPLEMENTATION_ -D_TRIVIAL_AGENT -DOS64 -o $(OBJDIR)/sharedClasses$(OSUFFIX)
LFLAGS=-shared -o
LFLAGS=-shared -o
IFLAGS=-I. -I$(JAVA_HOME)/include -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/include/darwin -I$(JAVA_HOME)/../include/darwin -I/usr/include
endif

ifeq ($(OS),win)
# Environment variable OSTYPE is set to cygwin if running under cygwin.
# Set our own macro to indicate we're running under cygwin.
@@ -160,36 +160,33 @@ ifeq ($(OS),win)

CC=cl
LD=link

PREFIX=
SUFFIX=.dll
OSUFFIX=.obj
ESUFFIX=.exe

CFLAGS=/DWIN32 /D_WINDOWS -Gy /LD /Zi /Odi /c /RTC1 /Fo"$(OBJDIR)/sharedClasses$(OSUFFIX)" /Fd"$(OBJDIR)"
LFLAGS=/NOLOGO /DLL /INCREMENTAL:NO /NODEFAULTLIB:LIBCMTD /OUT:
# Cater for JAVA_HOME being set either to the jre dir or the parent directory
# Cater for JAVA_HOME being set either to the jre dir or the parent directory.
IFLAGS=/I. /I"../../../lib/native/jvmti" /I"$(_JAVA_HOME)/../include" /I"$(_JAVA_HOME)/../include/win32" /I"$(_JAVA_HOME)/include" /I"$(_JAVA_HOME)/include/win32"

endif

.PHONY: $(OUTDIR) $(DESTDIR)

build: $(_OUTDIR) $(DESTDIR) $(DESTDIR)/$(PREFIX)sharedClasses$(SUFFIX)

######################
# Build shared library
######################
#######################
# Build shared library.
#######################

$(DESTDIR)/$(PREFIX)sharedClasses$(SUFFIX) : $(OBJDIR)/sharedClasses$(OSUFFIX)
$(CMD_PREFIX) $(LD) $(LFLAGS)$@ $<
ifneq ($(OS), Win)
ifneq ($(OS), win)
$(CHMOD) 755 $@
endif

######################
# Build an object file
######################
#######################
# Build an object file.
#######################

$(OBJDIR)/sharedClasses$(OSUFFIX): $(_SRCDIR)/sharedClasses.c
$(CMD_PREFIX) $(CC) $(CFLAGS) $(IFLAGS) $<
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2023 IBM Corp. and others
* Copyright (c) 2016, 2024 IBM Corp. and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which accompanies this distribution
@@ -209,28 +209,31 @@ public void execute(StfCoreExtension test, StfSharedClassesExtension sharedClass
.addProjectToClasspath("openj9.test.sharedClasses.jvmti")
.runClass(SharedClassesCacheChecker.class));
} else {
// Temporarily excluding the native tests from running on Windows
// due to: https://github.com/eclipse-openj9/openj9-systemtest/issues/38
if ( !PlatformFinder.isWindows() ) {
// Verify caches using a JVMTI native agent
String nativeExt = PlatformFinder.isWindows() ? ".dll" : ".so";
String nativePrefix = PlatformFinder.isWindows() ? "" : "lib";
FileRef agent = test.env().findTestDirectory("openj9.test.sharedClasses.jvmti/bin/native")
.childDirectory(test.env().getPlatformSimple())
.childFile(nativePrefix + "sharedClasses" + nativeExt);

if (!cacheDir.isEmpty()) {
cacheDir = "," + cacheDir;
}
String agentOptions = "expectedCacheCount=" + apiTest.expectedCacheCount + ","
+ "deleteCaches=true,"
+ "cachePrefix=" + apiTest.name() + cacheDir;

sharedClasses.doVerifyCachesUsingJVMTI(commentPrefix + "Verify caches using JVMTI",
apiTest.name(),
sharedClassesOption,
"-agentpath:" + agent + "=" + agentOptions);
// Verify caches using a JVMTI native agent.
String nativeExt;
if (PlatformFinder.isOSX()) {
nativeExt = ".dylib";
} else if (PlatformFinder.isWindows()) {
nativeExt = ".dll";
} else {
nativeExt = ".so";
}
String nativePrefix = PlatformFinder.isWindows() ? "" : "lib";
FileRef agent = test.env().findTestDirectory("openj9.test.sharedClasses.jvmti/bin/native")
.childDirectory(test.env().getPlatformSimple())
.childFile(nativePrefix + "sharedClasses" + nativeExt);

if (!cacheDir.isEmpty()) {
cacheDir = "," + cacheDir;
}
String agentOptions = "expectedCacheCount=" + apiTest.expectedCacheCount + ","
+ "deleteCaches=true,"
+ "cachePrefix=" + apiTest.name() + cacheDir;

sharedClasses.doVerifyCachesUsingJVMTI(commentPrefix + "Verify caches using JVMTI",
apiTest.name(),
sharedClassesOption,
"-agentpath:" + agent + "=" + agentOptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2023 IBM Corp. and others
* Copyright (c) 2016, 2024 IBM Corp. and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which accompanies this distribution
@@ -23,6 +23,7 @@

import static net.adoptopenjdk.stf.extensions.core.StfCoreExtension.Echo.ECHO_ON;

import java.io.File;
import java.util.ArrayList;

import net.adoptopenjdk.stf.environment.DirectoryRef;
@@ -186,18 +187,21 @@ public void setUp(StfCoreExtension test, StfSharedClassesExtension sharedClasses
// See whether the test data (20000 classes and jars) already exist.
// If not, create them in the first -systemtest-prereqs directory (or the default location if no -systemtest-prereqs were supplied).
DirectoryRef sharedClassesDataDir = null; // This will be initialised when we find it.
String dataSubdir = "sharedClassesTestData/v1";
int javaVersion = test.env().primaryJvm().getJavaVersion();
String dataSubdir = "sharedClassesTestData/v1/jdk" + javaVersion;
ArrayList<DirectoryRef> prereqRoots = test.env().getPrereqRoots();
int found = 0;
for (int i = 0 ; (i < prereqRoots.size()) && ( found == 0 ); i++ ) {
sharedClassesDataDir = prereqRoots.get(i).childDirectory(dataSubdir);
if (!sharedClassesDataDir.exists()) {
System.out.println(sharedClassesDataDir.getSpec() + " does not exist");
}
else {
System.out.println(sharedClassesDataDir.getSpec() + " exists");
FileRef sharedClassesJar = sharedClassesDataDir.childFile("classes.jar");
if (sharedClassesJar.exists()) {
System.out.println(sharedClassesDataDir.getSpec() + " exists and contains classes.jar");
found = 1;
}
break;
} else {
System.out.println(sharedClassesDataDir.getSpec() + "/classes.jar does not exist.");
deleteDirectory(sharedClassesDataDir.asJavaFile());
}
}

if ( found == 0 ) {
@@ -274,4 +278,23 @@ public void tearDown(StfCoreExtension test, StfSharedClassesExtension sharedClas
sharedClasses.doDestroySpecificCache("Destroy cache", "-Xshareclasses:name=" + SCSoftmxTestUtil.CACHE_NAME + ",cacheDir=" + cacheDir + "${cacheOperation}", SCSoftmxTestUtil.CACHE_NAME, cacheDir);
sharedClasses.doDestroySpecificNonPersistentCache("Destroy cache", "-Xshareclasses:name=" + SCSoftmxTestUtil.CACHE_NAME + ",cacheDir=" + cacheDir + "${cacheOperation}", SCSoftmxTestUtil.CACHE_NAME, cacheDir);
}

public void deleteDirectory(File directory) {
if (directory.exists()) {
File[] files = directory.listFiles();
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
deleteDirectory(file);
} else {
file.delete();
}
}
}
directory.delete();
} else {
System.out.println("Directory does not exist: " + directory.getAbsolutePath());
}
}

}