|
6 | 6 |
|
7 | 7 | This file now requires Ant 1.4.1. 2002-04-18
|
8 | 8 |
|
9 |
| - $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.34 2003/08/1121:27:52 barry Exp $ |
| 9 | + $Header: /cvsroot/pgsql/src/interfaces/jdbc/Attic/build.xml,v 1.35 2003/08/1123:42:04 barry Exp $ |
10 | 10 |
|
11 | 11 | -->
|
12 | 12 |
|
|
48 | 48 | </condition>
|
49 | 49 | <availableproperty="datasource"classname="javax.sql.DataSource"/>
|
50 | 50 | <availableproperty="ssl"classname="javax.net.ssl.SSLSocketFactory"/>
|
51 |
| - <availableproperty="junit"classname="junit.framework.Test" /> |
| 51 | + <availableproperty="junit"classname="junit.framework.Test"/> |
| 52 | + <availableproperty="junit.task"classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/> |
52 | 53 | <conditionproperty="jdbc2tests">
|
53 | 54 | <and>
|
54 |
| - <issetproperty="jdbc2"/> |
| 55 | + <or> |
| 56 | + <issetproperty="jdbc2"/> |
| 57 | + <issetproperty="jdbc3"/> |
| 58 | + </or> |
55 | 59 | <issetproperty="junit"/>
|
56 | 60 | </and>
|
57 | 61 | </condition>
|
58 | 62 | <conditionproperty="jdbc2optionaltests">
|
59 | 63 | <and>
|
60 |
| - <issetproperty="jdbc2"/> |
| 64 | + <or> |
| 65 | + <issetproperty="jdbc2"/> |
| 66 | + <issetproperty="jdbc3"/> |
| 67 | + </or> |
61 | 68 | <issetproperty="datasource"/>
|
62 | 69 | <issetproperty="junit"/>
|
63 | 70 | </and>
|
|
82 | 89 | <jarjarfile="${jardir}/postgresql.jar">
|
83 | 90 | <filesetdir="${builddir}">
|
84 | 91 | <includename="${package}/**/*.class" />
|
85 |
| - <excludename="${package}/test/**" /> |
86 | 92 | </fileset>
|
87 | 93 |
|
88 | 94 | <filesetdir="${srcdir}">
|
|
277 | 283 | <propertyname="username"value="test" />
|
278 | 284 | <!-- Password must be something. Doesn't matter if trust is used!-->
|
279 | 285 | <propertyname="password"value="password" />
|
280 |
| -<!-- junit.ui is one of textui, awtui, or swingui--> |
281 |
| - <propertyname="junit.ui"value="textui" /> |
282 | 286 |
|
| 287 | +<!-- The tests now build to a separate directory and jarfile from the |
| 288 | + driver build, to ensure we're really testing against the jar we just |
| 289 | + built, and not whatever happens to be in builddir.--> |
283 | 290 |
|
284 |
| -<targetname="test"depends="testjdbc2,testjdbc2optional,testjdbc3"> |
285 |
| - </target> |
| 291 | +<!-- This compiles and builds the test jarfile.--> |
| 292 | +<targetname="testjar"depends="jar"if="junit"> |
| 293 | + <mkdirdir="${builddir}/tests"/> |
| 294 | + <javacsrcdir="${srcdir}"destdir="${builddir}/tests"debug="${debug}"> |
| 295 | + <includename="${package}/test/**" /> |
286 | 296 |
|
287 |
| -<targetname="testjdbc2"depends="jar"if="jdbc2tests"> |
288 |
| - <javacsrcdir="${srcdir}"destdir="${builddir}"debug="${debug}"> |
289 |
| - <includename="${package}/test/jdbc2/*" /> |
290 |
| - </javac> |
291 |
| - <javafork="yes"classname="junit.${junit.ui}.TestRunner"taskname="junit"failonerror="true"> |
292 |
| - <argvalue="org.postgresql.test.jdbc2.Jdbc2TestSuite" /> |
293 |
| - <syspropertykey="database"value="${database}" /> |
294 |
| - <syspropertykey="username"value="${username}" /> |
295 |
| - <syspropertykey="password"value="${password}" /> |
296 |
| - <classpath> |
297 |
| - <pathelementlocation="${builddir}" /> |
298 |
| - <pathelementpath="${java.class.path}" /> |
299 |
| - </classpath> |
300 |
| - </java> |
301 |
| - </target> |
| 297 | + <excludename="${package}/test/jdbc2/**"unless="jdbc2tests"/> |
| 298 | + <excludename="${package}/test/jdbc2/optional/**"unless="jdbc2optionaltests" /> |
| 299 | + <excludename="${package}/test/jdbc3/**"unless="jdbc3tests" /> |
| 300 | + <excludename="${package}/test/util/**"unless="jdbc2optionaltests"/> |
302 | 301 |
|
303 |
| -<targetname="testjdbc2optional"depends="jar"if="jdbc2optionaltests"> |
304 |
| - <javacsrcdir="${srcdir}"destdir="${builddir}"debug="${debug}"> |
305 |
| - <includename="${package}/test/jdbc2/optional/**" /> |
306 |
| - <includename="${package}/test/util/**" /> |
307 |
| - </javac> |
308 |
| - <javafork="yes"classname="junit.${junit.ui}.TestRunner"taskname="junit"failonerror="true"> |
309 |
| - <argvalue="org.postgresql.test.jdbc2.optional.OptionalTestSuite" /> |
310 |
| - <syspropertykey="database"value="${database}" /> |
311 |
| - <syspropertykey="username"value="${username}" /> |
312 |
| - <syspropertykey="password"value="${password}" /> |
313 | 302 | <classpath>
|
314 |
| - <pathelementlocation="${builddir}" /> |
315 |
| - <pathelementpath="${java.class.path}" /> |
| 303 | + <pathelementlocation="${jardir}/postgresql.jar"/> |
316 | 304 | </classpath>
|
317 |
| - </java> |
| 305 | + </javac> |
| 306 | + <jarjarfile="${jardir}/postgresql-tests.jar"basedir="${builddir}/tests"/> |
318 | 307 | </target>
|
| 308 | + |
| 309 | +<!-- This actually runs the tests--> |
| 310 | +<targetname="runtest"depends="testjar"if="junit.task"> |
| 311 | + <junit> |
| 312 | + <formattertype="brief"usefile="false"/> |
319 | 313 |
|
320 |
| -<targetname="testjdbc3"depends="jar"if="jdbc3tests"> |
321 |
| - <javacsrcdir="${srcdir}"destdir="${builddir}"debug="${debug}"> |
322 |
| - <includename="${package}/test/jdbc3/*" /> |
323 |
| - <includename="${package}/test/util/*" /> |
324 |
| - </javac> |
325 |
| - <javafork="yes"classname="junit.${junit.ui}.TestRunner"taskname="junit"failonerror="true"> |
326 |
| - <argvalue="org.postgresql.test.jdbc3.Jdbc3TestSuite" /> |
327 | 314 | <syspropertykey="database"value="${database}" />
|
328 | 315 | <syspropertykey="username"value="${username}" />
|
329 | 316 | <syspropertykey="password"value="${password}" />
|
| 317 | + |
330 | 318 | <classpath>
|
331 |
| - <pathelementlocation="${builddir}" /> |
| 319 | + <pathelementlocation="${jardir}/postgresql.jar" /> |
| 320 | + <pathelementlocation="${jardir}/postgresql-tests.jar" /> |
332 | 321 | <pathelementpath="${java.class.path}" />
|
333 | 322 | </classpath>
|
334 |
| - </java> |
335 |
| - </target> |
336 | 323 |
|
| 324 | + <testname="org.postgresql.test.jdbc2.Jdbc2TestSuite"if="jdbc2tests"/> |
| 325 | + <testname="org.postgresql.test.jdbc2.optional.OptionalTestSuite"if="jdbc2optionaltests"/> |
| 326 | + <testname="org.postgresql.test.jdbc3.Jdbc3TestSuite"if="jdbc3tests"/> |
| 327 | + </junit> |
| 328 | + </target> |
| 329 | + |
| 330 | +<!-- This is the target invoked by the Makefile--> |
| 331 | +<targetname="test"depends="testjar,runtest"/> |
337 | 332 |
|
338 | 333 | </project>
|