Skip to content

Commit

Permalink
fix lib to ${lib} for junit jar and modify some paths for the test bu…
Browse files Browse the repository at this point in the history
…ild dir
  • Loading branch information
bikegeek committed Sep 17, 2024
1 parent 01a176c commit 71b763d
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="src.webapp.dir" location="webapp"/>
<property name="test.build.dir" location="build/test"/>
<property name="test.build.dir" location="build/edu/ucar/metviewer/test"/>
<property name="test.src.dir" location="java/edu/ucar/metviewer/test"/>


Expand Down Expand Up @@ -248,7 +248,7 @@
</path>

<path id="classpath.test">
<pathelement location="lib/junit-4.11.jar"/>
<pathelement location="${lib}/junit-4.11.jar"/>
<pathelement location="${lib}/hamcrest-core-1.3.jar"/>
<pathelement location="${lib}/mockito-all-1.9.5.jar"/>
<pathelement location="${lib}/junit-platform-console-standalone-1.4.0.jar"/>
Expand All @@ -274,8 +274,7 @@
<!-- Compile the project java files -->
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<include name="**/*.java"/>
<include name="**/test/mvutil/**"/>
<!-- exclude name="**/test/**"/ -->
<exclude name="**/test/**"/>
<!-- aurora-->
<exclude name="edu/ucar/metviewer/db/mariadb/**" if="db.management.system.aurora"/>
<!-- mysql-->
Expand All @@ -293,7 +292,6 @@
<!-- Compile the project java files -->
<javac sourcepath="" srcdir="${src}" destdir="${build}" includeantruntime="false">
<include name="**/*.java"/>
<include name="edu/ucar/metviewer/test/**" />
<exclude name="edu/ucar/metviewer/db/mariadb/**" if="db.management.system.aurora"/>
<exclude name="**/TestMariaDbDatabaseManager.java" if="db.management.system.aurora"/>
<exclude name="**/TestMysqlDatabaseManager.java" if="db.management.system.aurora"/>
Expand All @@ -314,23 +312,30 @@
</target>

<!-- JUnit tests -->
<target name="test-compile" depends="compile">
<mkdir dir="${test.build.dir}" />
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" includeantruntime="false">
<target name="test-compile" depends="compile, compile-all">
<javac srcdir="${test.src.dir}"
destdir="${test.build.dir}"
includeantruntime="true"
nowarn="yes"
debug="true">
<classpath refid="classpath.test"/>
<include name="edu/ucar/metviewer/test/**" />
<include name="edu/ucar/metviewer/test/**Test" />
</javac>
<property name="d" refid="classpath.test"/>
<echo>classpath.test = ${d}</echo>

</target>

<target name="test" depends="test-compile">
<junit printsummary="on" haltonfailure="yes" fork="true">
<classpath>
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
<classpath >
<path refid="classpath.test"/>
<pathelement location="${test.build.dir}"/>
</classpath>

<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${test.src.dir}" includes="${test.src.dir}/mvutil/TestRunner" />
<fileset dir="${test.build.dir}" includes="**/*Test*.java" />
</batchtest>
</junit>
</target>
Expand Down

0 comments on commit 71b763d

Please sign in to comment.