ICU-11501 Removed -nothrow option handling code in the test framework. The option is still accepted, but it has no effects.

X-SVN-Rev: 37052
This commit is contained in:
Yoshito Umaoka 2015-02-23 13:23:44 +00:00
parent df67b1a7d0
commit aac5b528c8
3 changed files with 17 additions and 41 deletions

View file

@ -1,6 +1,6 @@
<!--
*******************************************************************************
* Copyright (C) 1997-2014, International Business Machines Corporation and *
* Copyright (C) 1997-2015, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
-->
@ -159,28 +159,28 @@
<property name="jvm_options" value="${env.JVM_OPTIONS}"/>
<target name="check" description="Run the standard ICU4J test suite">
<antcall target="_runCheck">
<param name="runcheck.arg" value="-n"/>
<param name="runcheck.arg" value=""/>
<param name="runcheck.jvmarg" value="${jvm_options} -ea"/>
</antcall>
</target>
<target name="exhaustiveCheck" description="Run the standard ICU4J test suite in exhaustive mode">
<antcall target="_runCheck">
<param name="runcheck.arg" value="-n -e10"/>
<param name="runcheck.arg" value="-e10"/>
<param name="runcheck.jvmarg" value="${jvm_options} -ea"/>
</antcall>
</target>
<target name="timeZoneCheck" description="Run the complete test for TimeZoneRoundTripAll">
<antcall target="_runCheck">
<param name="runcheck.arg" value="-n -prop:TimeZoneRoundTripAll=true Core/Format/DateFormat/TimeZoneFormatTest -v"/>
<param name="runcheck.arg" value="-prop:TimeZoneRoundTripAll=true Core/Format/DateFormat/TimeZoneFormatTest -v"/>
<param name="runcheck.jvmarg" value="${jvm_options}"/>
</antcall>
</target>
<target name="jdktzCheck" description="Run the standard ICU4J test suite with JDK TimeZone">
<antcall target="_runCheck">
<param name="runcheck.arg" value="-n"/>
<param name="runcheck.arg" value=""/>
<param name="runcheck.jvmarg" value="${jvm_options} -Dcom.ibm.icu.util.TimeZone.DefaultTimeZoneType=JDK"/>
</antcall>
</target>
@ -211,12 +211,11 @@
</target>
<target name="_runTestArgCheck" unless="testarg">
<echo message="No test arguments are supplied. Using the default argument '-n'."/>
<echo message="No test arguments are supplied."/>
<echo message="For specifying test arguments, use '-Dtestarg=[test args]' as"/>
<echo message="ant command line argument. For example:"/>
<echo message=" &#x3E;ant runTest -Dtestarg=&#x22;Core/Format -e10&#x22;"/>
<echo message="for running ICU4J core format test suite in exhaustive mode."/>
<property name="testarg" value="-n"/>
</target>
<target name="runTest" depends="_runTestArgCheck" description="Run a ICU4J test case, without calling any other build targets">
@ -247,7 +246,7 @@
<target name="packagingCheck" depends="info, core, packaging-tests" description="Run packaging tests">
<!-- region data but no language data -->
<java classname="com.ibm.icu.dev.test.TestPackaging" fork="yes" failonerror="true">
<arg line="-n -w"/>
<arg line="-w"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.charset.jar}"/>
@ -258,7 +257,7 @@
</java>
<!-- language data but no region data -->
<java classname="com.ibm.icu.dev.test.TestPackaging" fork="yes" failonerror="true">
<arg line="-n -w"/>
<arg line="-w"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.charset.jar}"/>
@ -269,7 +268,7 @@
</java>
<!-- neither region nor language data -->
<java classname="com.ibm.icu.dev.test.TestPackaging" fork="yes" failonerror="true">
<arg line="-n -w"/>
<arg line="-w"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.charset.jar}"/>
@ -281,7 +280,6 @@
<target name="coreCheck" depends="info, core, currdata, langdata, regiondata, core-tests" description="Run only the core tests">
<java classname="com.ibm.icu.dev.test.TestAllCore" fork="yes" failonerror="true">
<arg line="-n"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.currdata.jar}"/>
@ -295,7 +293,6 @@
<target name="collateCheck" depends="info, core, collate, currdata, langdata, regiondata, core-tests, collate-tests" description="Run only the collation tests">
<java classname="com.ibm.icu.dev.test.TestAllCollate" fork="yes" failonerror="true">
<arg line="-n"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.collate.jar}"/>
@ -313,7 +310,6 @@
<target name="translitCheck" depends="info, core, translit, translit-tests" description="Run the ICU4J Translit test suite">
<java classname="com.ibm.icu.dev.test.TestAllTranslit" fork="yes" failonerror="true">
<arg line="-n"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.translit.jar}"/>
@ -330,7 +326,6 @@
<target name="_runLocalespiCheck" depends="localespi, localespi-tests">
<java classname="com.ibm.icu.dev.test.localespi.TestAll" fork="yes" failonerror="true">
<jvmarg line="-Djava.ext.dirs=${icu4j.core.dir}/${jar.dir}${path.separator}${icu4j.localespi.dir}/${jar.dir}${path.separator}${icu4j.collate.dir}/${jar.dir}${path.separator}${icu4j.currdata.dir}/${jar.dir}${path.separator}${icu4j.langdata.dir}/${jar.dir}${path.separator}${icu4j.regiondata.dir}/${jar.dir}${path.separator}${java.ext.dirs}"/>
<arg value="-n"/>
<classpath>
<pathelement location="${icu4j.localespi-tests.jar}"/>
<pathelement location="${icu4j.test-framework.jar}"/>
@ -339,7 +334,7 @@
</target>
<target name="secureCheck" depends="main, jar, icu4jtestsJar" description="Run the secure (applet-like) ICU4J test suite">
<property name="securecheck.arg" value="-n -w"/>
<property name="securecheck.arg" value="-w"/>
<property name="securecheck.jvmarg"
value="${jvm_options} -Djava.security.manager -Djava.security.policy=${shared.dir}/data/security.policy -Djava.awt.headless=true"/>
@ -870,7 +865,6 @@
<jacoco:coverage destfile="${jacoco.exec.data.file}">
<java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
<arg value="-n"/>
<jvmarg line="${jvm_options} -ea -Djava.awt.headless=true"/>
<classpath>
<pathelement location="${icu4j.jar.file}"/>
@ -973,7 +967,6 @@
<!-- Run the test suites -->
<java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
<arg value="-n"/>
<classpath>
<pathelement location="${icu4j.core.jar}"/>
<pathelement location="${icu4j.collate.jar}"/>
@ -1370,7 +1363,6 @@
<target name="moduleCheck" description="Run tests for a ICU4J module jar">
<java classname="com.ibm.icu.dev.test.TestAll" fork="yes" failonerror="true">
<arg value="-nothrow"/>
<arg value="-nodata"/>
<classpath>
<pathelement location="${module.jar}"/>

View file

@ -93,9 +93,6 @@ public class TestFmwk extends AbstractTestLog {
// ICUTestError is one produced by errln.
// We don't need to include useless stack trace information for
// such case.
if (!params.nothrow) {
throw new RuntimeException(ex);
}
return;
}
if (ex instanceof ExceptionInInitializerError){
@ -114,19 +111,11 @@ public class TestFmwk extends AbstractTestLog {
msg.indexOf("java.util.MissingResourceException") >= 0) {
if (params.warnings || params.nodata) {
warnln(msg);
} else if (params.nothrow) {
errln(msg);
} else {
ex.printStackTrace();
throw new RuntimeException(ex);
errln(msg);
}
} else {
if (params.nothrow) {
errln(msg);
} else {
errln(msg);
throw new RuntimeException(ex);
}
errln(msg);
}
}
// use this instead of new random so we get a consistent seed
@ -968,7 +957,8 @@ public class TestFmwk extends AbstractTestLog {
// calls
// pw.println(" -m[emory] print memory usage and force gc for
// each test");
pw.println(" -n[othrow] Message on test failure rather than exception");
pw.println(" -n[othrow] Message on test failure rather than exception.\n");
pw.println(" This is the default behavior and has no effects on ICU 55+.");
pw.println(" -p[rompt] Prompt before exiting");
pw.println(" -prop:<key>=<value> Set optional property used by this test");
pw.println(" -q[uiet] Do not show warnings");
@ -1161,7 +1151,6 @@ public class TestFmwk extends AbstractTestLog {
public static class TestParams {
public boolean prompt;
public boolean nothrow;
public boolean verbose;
public boolean quiet;
public int listlevel;
@ -1177,7 +1166,7 @@ public class TestFmwk extends AbstractTestLog {
public State stack;
public StringBuffer errorSummary;
public StringBuffer errorSummary = new StringBuffer();
private StringBuffer timeLog;
private Map<String, List<String>> knownIssues;
@ -1256,8 +1245,7 @@ public class TestFmwk extends AbstractTestLog {
} else if (arg.equals("-memory") || arg.equals("-m")) {
params.memusage = true;
} else if (arg.equals("-nothrow") || arg.equals("-n")) {
params.nothrow = true;
params.errorSummary = new StringBuffer();
// Default since ICU 55. This option has no effects.
} else if (arg.equals("-describe") || arg.equals("-d")) {
params.describe = true;
} else if (arg.startsWith("-r")) {
@ -1584,9 +1572,6 @@ public class TestFmwk extends AbstractTestLog {
}
if (level == ERR) {
if (!nothrow) {
throw new ICUTestError(message);
}
if (!suppressIndent && errorSummary != null && stack !=null
&& (errorCount == stack.ec + 1)) {
stack.appendPath(errorSummary);

View file

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 1996-2012, International Business Machines Corporation and *
* Copyright (C) 1996-2015, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -127,7 +127,6 @@ public class TestUtilities extends TestFmwk {
// check boilerplate
List argList = new ArrayList();
argList.add("TestMain");
if (params.nothrow) argList.add("-nothrow");
if (params.verbose) argList.add("-verbose");
String[] args = new String[argList.size()];
argList.toArray(args);