forked from eclipse-openj9/openj9
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci skip] Signed-off-by: Yixin Qian <Yixin.Qian@ibm.com>
- Loading branch information
Showing
4 changed files
with
193 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0"?> | ||
|
||
<!-- | ||
Copyright (c) 2021, 2021 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 and is available at https://www.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 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]. | ||
[1] https://www.gnu.org/software/classpath/license.html | ||
[2] http://openjdk.java.net/legal/assembly-exception.html | ||
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception | ||
--> | ||
|
||
<project name="libpathTest" default="build" basedir="."> | ||
<taskdef resource="net/sf/antcontrib/antlib.xml" /> | ||
<description> | ||
Build jython hello | ||
</description> | ||
|
||
<!-- set properties for this build --> | ||
<property name="DEST" value="${BUILD_ROOT}/functional/cmdLineTests/jython" /> | ||
<property name="src" location="./src"/> | ||
<property name="build" location="./bin"/> | ||
<property name="LIB" value="jython"/> | ||
<import file="${TEST_ROOT}/TKG/scripts/getDependencies.xml"/> | ||
|
||
<target name="init"> | ||
<mkdir dir="${DEST}" /> | ||
<mkdir dir="${build}" /> | ||
</target> | ||
|
||
<target name="compile" depends="init,getDependentLibs" description="Using java ${JDK_VERSION} to compile the source "> | ||
<echo>Ant version is ${ant.version}</echo> | ||
<echo>============COMPILER SETTINGS============</echo> | ||
<echo>===fork: yes</echo> | ||
<echo>===executable: ${compiler.javac}</echo> | ||
<echo>===debug: on</echo> | ||
<echo>===destdir: ${DEST}</echo> | ||
<javac srcdir="${src}" destdir="${build}" debug="true" fork="true" executable="${compiler.javac}" includeAntRuntime="false" encoding="ISO-8859-1"> | ||
<classpath> | ||
<pathelement location="${LIB_DIR}/jython-standalone.jar" /> | ||
</classpath> | ||
</javac> | ||
</target> | ||
|
||
<target name="dist" depends="compile" description="generate the distribution"> | ||
<jar jarfile="${DEST}/cmdLineTester_jython.jar" filesonly="true"> | ||
<fileset dir="${build}" /> | ||
<fileset dir="${src}" /> | ||
</jar> | ||
<copy todir="${DEST}"> | ||
<fileset dir="${src}/../" includes="*.xml" /> | ||
<fileset dir="${src}/../" includes="*.mk" /> | ||
</copy> | ||
</target> | ||
|
||
<target name="clean" depends="dist" description="clean up"> | ||
<!-- Delete the ${build} directory trees --> | ||
<delete dir="${build}" /> | ||
</target> | ||
|
||
<target name="build" > | ||
<antcall target="clean" inheritall="true" /> | ||
</target> | ||
</project> |
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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
|
||
<!-- | ||
Copyright (c) 2021, 2021 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 and is available at https://www.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 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]. | ||
[1] https://www.gnu.org/software/classpath/license.html | ||
[2] http://openjdk.java.net/legal/assembly-exception.html | ||
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception | ||
--> | ||
|
||
<!DOCTYPE suite SYSTEM "cmdlinetester.dtd"> | ||
|
||
<suite id="jython" timeout="300"> | ||
|
||
<test id="jython-hello"> | ||
<command>$EXE$ -XshowSettings:vm -Dpython.options.showJavaExceptions=true -Dpython.options.includeJavaStackInExceptions=true -Dpython.options.showPythonProxyExceptions=true -cp $Q$$JARPATH$$Q$ JythonHello</command> | ||
<output type="success" regex="no">Hello Python World!</output> | ||
</test> | ||
|
||
</suite> |
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,51 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<!-- | ||
Copyright (c) 2021, 2021 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 and is available at https://www.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 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]. | ||
[1] https://www.gnu.org/software/classpath/license.html | ||
[2] http://openjdk.java.net/legal/assembly-exception.html | ||
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception | ||
--> | ||
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../TKG/playlist.xsd"> | ||
<test> | ||
<testCaseName>cmdLineTester_jython</testCaseName> | ||
<variations> | ||
<variation>NoOptions</variation> | ||
<variation>Mode108</variation> | ||
<variation>Mode109</variation> | ||
<variation>Mode116</variation> | ||
<variation>Mode608</variation> | ||
<variation>Mode609</variation> | ||
</variations> | ||
<command>$(JAVA_COMMAND) $(JVM_OPTIONS)\ | ||
-DJARPATH=$(Q)$(LIB_DIR)$(D)jython-standalone.jar$(P)$(TEST_RESROOT)$(D)cmdLineTester_jython.jar$(Q) \ | ||
-DEXE=$(SQ)$(JAVA_COMMAND) $(JVM_OPTIONS)$(SQ) \ | ||
-jar $(CMDLINETESTER_JAR) -config $(Q)$(TEST_RESROOT)$(D)jython.xml$(Q) \ | ||
-explainExcludes -xids all,$(PLATFORM),$(VARIATION) -nonZeroExitWhenError; \ | ||
$(TEST_STATUS)</command> | ||
<levels> | ||
<level>sanity</level> | ||
</levels> | ||
<groups> | ||
<group>functional</group> | ||
</groups> | ||
<impls> | ||
<impl>openj9</impl> | ||
<impl>ibm</impl> | ||
</impls> | ||
</test> | ||
</playlist> |
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,32 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021, 2021 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 and is available at https://www.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 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]. | ||
* | ||
* [1] https://www.gnu.org/software/classpath/license.html | ||
* [2] http://openjdk.java.net/legal/assembly-exception.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception | ||
*******************************************************************************/ | ||
import org.python.core.PyList; | ||
import org.python.core.PyObject; | ||
import org.python.core.PyString; | ||
import org.python.util.InteractiveInterpreter; | ||
|
||
public class JythonHello { | ||
public static void main(String[] arg) throws Throwable { | ||
InteractiveInterpreter interp = new InteractiveInterpreter(); | ||
interp.exec("print('Hello Python World!')"); | ||
} | ||
} |