You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2012/06/20 19:58:08 UTC

svn commit: r1352238 - /lucene/dev/trunk/lucene/common-build.xml

Author: hossman
Date: Wed Jun 20 17:58:08 2012
New Revision: 1352238

URL: http://svn.apache.org/viewvc?rev=1352238&view=rev
Log:
LUCENE-4146: improvements to how -Dtests.iters works with -Dtests.method/-Dtestmethod

Modified:
    lucene/dev/trunk/lucene/common-build.xml

Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1352238&r1=1352237&r2=1352238&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Wed Jun 20 17:58:08 2012
@@ -687,7 +687,7 @@
   <condition property="tests.class" value="*.${testcase}">
     <isset property="testcase" />
   </condition>
-  <condition property="tests.method" value="${testmethod}">
+  <condition property="tests.method" value="${testmethod}*">
     <isset property="testmethod" />
   </condition>
   <condition property="tests.showSuccess" value="true">
@@ -719,6 +719,18 @@
             <isset property="tests.iter" />
           </condition>
         </fail>
+        <!-- this combo makes no sense LUCENE-4146 -->
+        <fail message="You are attempting to use 'tests.iters' in combination with a 'tests.method' value with does not end in a '*' -- This combination makes no sense, because the 'tests.method' filter will be unable to match the synthetic test names generated by the multiple iterations.">
+          <condition>
+            <and>
+              <isset property="tests.iters" />
+              <isset property="tests.method" />
+              <not>
+                <matches pattern="\*$" string="${tests.method}" />
+              </not>
+            </and>
+          </condition>
+        </fail>
 
         <!-- Defaults. -->
         <property name="tests.class"  value="" />
@@ -909,7 +921,7 @@
 # - 'tests.class' is a class-filtering shell-like glob pattern,
 #   'testcase' is an alias of "tests.class=*.${testcase}"
 # - 'tests.method' is a method-filtering glob pattern.
-#   'testmethod' is an alias of "tests.method=${testmethod}"
+#   'testmethod' is an alias of "tests.method=${testmethod}*"
 #
 
 # Run a single test case (variants)
@@ -930,9 +942,6 @@ ant test "-Dtests.method=*esi*"
 # Run with a given seed (seed is a hex-encoded long).
 ant test -Dtests.seed=DEADBEEF
 
-# Repeats a given test N times (note filters).
-ant test -Dtests.iters=N -Dtestcase=ClassName -Dtestmethod=mytest
-
 # Repeats _all_ tests of ClassName N times. Every test repetition
 # will have a different seed.
 ant test -Dtests.iters=N -Dtestcase=ClassName
@@ -942,6 +951,14 @@ ant test -Dtests.iters=N -Dtestcase=Clas
 # seed.
 ant test -Dtests.iters=N -Dtestcase=ClassName -Dtests.seed=dead:beef
 
+# Repeats a given test N times (note the filters - individual test
+# repetitions are given suffixes, ie: testFoo[0], testFoo[1], etc...
+# so using testmethod or tests.method ending in a glob is necessary
+# to ensure iterations are run).
+ant test -Dtests.iters=N -Dtestcase=ClassName -Dtestmethod=mytest
+ant test -Dtests.iters=N -Dtestcase=ClassName -Dtests.method=mytest*
+
+
 #
 # Test groups. ----------------------------------------------------
 #