You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/12/17 16:07:43 UTC

cvs commit: ant/src/testcases/org/apache/tools/ant/taskdefs JavacTest.java

bodewig     2004/12/17 07:07:43

  Modified:    .        build.xml
               src/testcases/org/apache/tools/ant/taskdefs JavacTest.java
  Log:
  Propagate build.compiler to tests
  
  Revision  Changes    Path
  1.446     +9 -0      ant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ant/build.xml,v
  retrieving revision 1.445
  retrieving revision 1.446
  diff -u -r1.445 -r1.446
  --- build.xml	16 Dec 2004 14:06:59 -0000	1.445
  +++ build.xml	17 Dec 2004 15:07:42 -0000	1.446
  @@ -593,6 +593,13 @@
       <condition property="running.in.gump">
         <isset property="gump.merge"/>
       </condition>
  +
  +    <condition property="build.compiler" value="classic">
  +      <not>
  +        <isset property="jdk1.3+"/>
  +      </not>
  +    </condition>
  +    <property name="build.compiler" value="modern"/>
     </target>
   
   
  @@ -1473,6 +1480,7 @@
         <sysproperty key="tests-classpath.value"
                      value="${tests-classpath.value}"/>
         <sysproperty key="root" file="${basedir}"/>
  +      <sysproperty key="build.compiler" value="${build.compiler}"/>
   
         <formatter type="brief" usefile="false"/>
   
  @@ -1633,6 +1641,7 @@
         <sysproperty key="tests-classpath.value"
                      value="${tests-classpath.value}"/>
         <sysproperty key="root" file="${basedir}"/>
  +      <sysproperty key="build.compiler" value="${build.compiler}"/>
         <classpath refid="tests-classpath"/>
         <formatter type="plain" usefile="false"/>
         <test name="${testcase}"/>
  
  
  
  1.16      +15 -9     ant/src/testcases/org/apache/tools/ant/taskdefs/JavacTest.java
  
  Index: JavacTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/JavacTest.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JavacTest.java	9 Mar 2004 16:48:57 -0000	1.15
  +++ JavacTest.java	17 Dec 2004 15:07:43 -0000	1.16
  @@ -144,13 +144,18 @@
           // check defaults
           String compiler = javac.getCompiler();
           assertNotNull(compiler);
  -        assertTrue("default value",
  -                   "javac1.1".equals(compiler)
  -                   || "javac1.2".equals(compiler)
  -                   || "javac1.3".equals(compiler)
  -                   || "javac1.4".equals(compiler)
  -                   || "javac1.5".equals(compiler)
  -                   || "classic".equals(compiler));
  +        if (System.getProperty("build.compiler") != null) {
  +            assertEquals(System.getProperty("build.compiler"),
  +                         compiler);
  +        } else {
  +            assertTrue("default value",
  +                       "javac1.1".equals(compiler)
  +                       || "javac1.2".equals(compiler)
  +                       || "javac1.3".equals(compiler)
  +                       || "javac1.4".equals(compiler)
  +                       || "javac1.5".equals(compiler)
  +                       || "classic".equals(compiler));
  +        }
   
           javac.setFork(true);
           assertNotNull(javac.getCompiler());
  @@ -160,7 +165,8 @@
           // check build.compiler provides defaults
           javac = new Javac();
           javac.setProject(project);
  -        project.setNewProperty("build.compiler", "jikes");
  +        // setUserProperty to override system properties
  +        project.setUserProperty("build.compiler", "jikes");
           compiler = javac.getCompiler();
           assertNotNull(compiler);
           assertEquals("jikes", compiler);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org