You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/10/29 21:41:40 UTC

svn commit: r1194995 - in /lucene/dev/branches/lucene2621/lucene: common-build.xml src/test-framework/org/apache/lucene/util/LuceneTestCase.java

Author: rmuir
Date: Sat Oct 29 19:41:40 2011
New Revision: 1194995

URL: http://svn.apache.org/viewvc?rev=1194995&view=rev
Log:
LUCENE-3490: fix build.xml, allow for preflex-only testing, etc

Modified:
    lucene/dev/branches/lucene2621/lucene/common-build.xml
    lucene/dev/branches/lucene2621/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java

Modified: lucene/dev/branches/lucene2621/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/common-build.xml?rev=1194995&r1=1194994&r2=1194995&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/common-build.xml (original)
+++ lucene/dev/branches/lucene2621/lucene/common-build.xml Sat Oct 29 19:41:40 2011
@@ -83,7 +83,7 @@
     </or>
   </condition>
   <property name="tests.multiplier" value="1" />
-  <property name="tests.codec" value="randomPerField" />
+  <property name="tests.postingsformat" value="random" />
   <property name="tests.codecprovider" value="random" />
   <property name="tests.locale" value="random" />
   <property name="tests.timezone" value="random" />
@@ -547,7 +547,7 @@
 	      <!-- allow tests to control debug prints -->
 	      <sysproperty key="tests.verbose" value="${tests.verbose}"/>
               <!-- set the codec tests should run with -->
-	      <sysproperty key="tests.codec" value="${tests.codec}"/>
+	      <sysproperty key="tests.postingsformat" value="${tests.postingsformat}"/>
               <!-- set the codec provider tests should run with -->
 	      <sysproperty key="tests.codecprovider" value="${tests.codecprovider}"/>
               <!-- set the locale tests should run with -->

Modified: lucene/dev/branches/lucene2621/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2621/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java?rev=1194995&r1=1194994&r2=1194995&view=diff
==============================================================================
--- lucene/dev/branches/lucene2621/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/lucene2621/lucene/src/test-framework/org/apache/lucene/util/LuceneTestCase.java Sat Oct 29 19:41:40 2011
@@ -141,9 +141,7 @@ public abstract class LuceneTestCase ext
   // each test case (non-J4 tests) and each test class (J4
   // tests)
   /** Gets the postingsFormat to run tests with. */
-  public static final String TEST_POSTINGSFORMAT = System.getProperty("tests.postingsFormat", "random");
-  /** Gets the codec to run tests with. */
-  public static final String TEST_CODEC = System.getProperty("tests.codec", "random");
+  public static final String TEST_POSTINGSFORMAT = System.getProperty("tests.postingsformat", "random");
   /** Gets the codecprovider to run tests with */
   public static final String TEST_CODECPROVIDER = System.getProperty("tests.codecprovider", "random");
   /** Gets the locale to run tests with */
@@ -258,7 +256,8 @@ public abstract class LuceneTestCase ext
     savedCodecProvider = CodecProvider.getDefault();
     final CodecProvider cp;
     if ("random".equals(TEST_CODECPROVIDER)) {
-      if ("random".equals(TEST_POSTINGSFORMAT) && random.nextInt(4) == 0) { // preflex-only setup
+      // TODO: kinda jaky that Lucene3x will eventually be a real codec, deal with this later.
+      if ("Lucene3x".equals(TEST_POSTINGSFORMAT) || ("random".equals(TEST_POSTINGSFORMAT) && random.nextInt(4) == 0)) { // preflex-only setup
         cp = new CoreCodecProvider() {
           final Codec preflexRW = new PreFlexRWCodec();
           @Override
@@ -1281,7 +1280,7 @@ public abstract class LuceneTestCase ext
   // extra params that were overridden needed to reproduce the command
   private static String reproduceWithExtraParams() {
     StringBuilder sb = new StringBuilder();
-    if (!TEST_CODEC.equals("randomPerField")) sb.append(" -Dtests.codec=").append(TEST_CODEC);
+    if (!TEST_POSTINGSFORMAT.equals("random")) sb.append(" -Dtests.postingsformat=").append(TEST_POSTINGSFORMAT);
     if (!TEST_LOCALE.equals("random")) sb.append(" -Dtests.locale=").append(TEST_LOCALE);
     if (!TEST_TIMEZONE.equals("random")) sb.append(" -Dtests.timezone=").append(TEST_TIMEZONE);
     if (!TEST_DIRECTORY.equals("random")) sb.append(" -Dtests.directory=").append(TEST_DIRECTORY);