Skip to content

Commit

Permalink
The changes reflect the feature request eclipse-openj9#16416 - part 3
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Kamal <[email protected]>
  • Loading branch information
h3110n3rv3 committed Dec 17, 2024
1 parent 81ebf3b commit 44209db
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/functional/cmdLineTests/xtraceTests/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>

<!--
Copyright IBM Corp. and others 2020
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] https://openjdk.org/legal/assembly-exception.html
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
-->

<project name="cmdLineTests" default="build" basedir=".">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<description>
Build cmdLineTests xtraceTests
</description>

<import file="${TEST_ROOT}/functional/cmdLineTests/buildTools.xml"/>

<!-- set properties for this build -->
<property name="DEST" value="${BUILD_ROOT}/functional/cmdLineTests/xtraceTests" />
<property name="src" location="." />

<target name="dist" description="generate the distribution">
<copy todir="${DEST}">
<fileset dir="${src}" includes="*.xml,*.mk"/>
</copy>
</target>

<target name="build" depends="buildCmdLineTestTools">
<antcall target="dist" inheritall="true" />
</target>
</project>
46 changes: 46 additions & 0 deletions test/functional/cmdLineTests/xtraceTests/playlist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version='1.0' encoding='UTF-8'?>
<!--
Copyright IBM Corp. and others 2020
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] https://openjdk.org/legal/assembly-exception.html
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
-->
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../TKG/playlist.xsd">
<include>../variables.mk</include>
<test>
<testCaseName>xtraceTests</testCaseName>
<variations>
<variation>Mode109</variation>
</variations>
<command>$(JAVA_COMMAND) $(CMDLINETESTER_JVM_OPTIONS) \
-DEXE=$(SQ)$(JAVA_COMMAND) $(JVM_OPTIONS) $(SQ) \
-jar $(CMDLINETESTER_JAR) -config $(Q)$(TEST_RESROOT)$(D)xtraceTests.xml$(Q) \
-nonZeroExitWhenError; \
$(TEST_STATUS)</command>
<levels>
<level>extended</level>
</levels>
<groups>
<group>functional</group>
</groups>
<impls>
<impl>openj9</impl>
<impl>ibm</impl>
</impls>
</test>
</playlist>
37 changes: 37 additions & 0 deletions test/functional/cmdLineTests/xtraceTests/xtraceTests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!--
Copyright IBM Corp. and others 2016
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] https://openjdk.org/legal/assembly-exception.html
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
-->

<!DOCTYPE suite SYSTEM "cmdlinetester.dtd">

<suite id="xtrace commandline tests" timeout="120">

<!-- These tests check -Xteace is working correctly and error/warning messages are proper. -->

<test id="Test -Xtrace:methods={java/lang/String.concat'()'},methodStrArgLen='a',print=mt ">
<command>$EXE$ -Xtrace:methods={java/lang/String.concat'()'},print=mt -version</command>
<output regex="no" type="success">Trace option unrecognized: -Xtrace:methodStrArgLen</output>
<output regex="no" type="required">Error processing trace option, detail: methodstrarglen takes an unsigned integer value from 1 to 128</output>
<output regex="yes" javaUtilPattern="yes" type="required">Error processing trace option, detail: Invalid character(s) encountered in decimal number .?.</output>
</test>
</suite>

0 comments on commit 44209db

Please sign in to comment.