blob: 8b7006e97c1a9f64863ff70fd42f88041ac7da93 [file] [log] [blame]
<?xml version="1.0"?>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
Before you can run these subtargets directly, you need
to call at top-level: ant deploy-contrib compile-core-test
<project name="vertica" default="jar">
<import file="../build-contrib.xml"/>
<property environment="env"/>
<!-- ================================================================== -->
<!-- Run unit tests -->
<!-- Override with our own version so we can set hadoop.alt.classpath -->
<!-- and Hadoop logger properties -->
<!-- ================================================================== -->
<target name="test" depends="compile-test, compile" if="test.available">
<echo message="contrib: ${name}"/>
<delete dir="${hadoop.log.dir}"/>
<mkdir dir="${hadoop.log.dir}"/>
<delete dir="${build.test}/data"/>
<mkdir dir="${build.test}/data" />
printsummary="yes" showoutput="${test.output}"
haltonfailure="no" fork="yes" maxmemory="256m"
errorProperty="tests.failed" failureProperty="tests.failed"
<!-- uncomment this if you want to attach a debugger -->
<jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=2601" />
<sysproperty key="" value="${build.test}/data"/>
<sysproperty key="build.test" value="${build.test}"/>
<sysproperty key="" value="${name}"/>
Added property needed to use the .class files for compilation
instead of depending on hadoop-*-core.jar
<sysproperty key="hadoop.alt.classpath"
value="${hadoop.root}/build/classes" />
<!-- we want more log4j output when running unit tests -->
<sysproperty key="hadoop.root.logger"
value="DEBUG,console" />
<!-- requires fork=yes for:
relative File paths to use the specified user.dir
classpath to use build/contrib/*.jar
<sysproperty key="user.dir" value="${build.test}/data"/>
<sysproperty key="" value="${}"/>
<sysproperty key="hadoop.test.localoutputfile" value="${hadoop.test.localoutputfile}"/>
<sysproperty key="hadoop.log.dir" value="${hadoop.log.dir}"/>
<!-- Path to SQL setup script. -->
<sysproperty key="vertica.test_setup" value="${basedir}/testdata/vertica_test.sql" />
<!-- Vertica database parameters -->
<sysproperty key="vertica.hostname" value="localhost" />
<sysproperty key="vertica.database" value="db" />
<sysproperty key="vertica.username" value="dbadmin" />
<sysproperty key="vertica.password" value="" />
<!-- tools.jar from Sun JDK also required to invoke javac. -->
<path refid="test.classpath"/>
<path refid="contrib-classpath"/>
<pathelement path="${env.JAVA_HOME}/lib/tools.jar" />
<formatter type="${test.junit.output.format}" />
<batchtest todir="${build.test}" unless="testcase">
<fileset dir="${src.test}"
includes="**/Test*.java" excludes="**/${test.exclude}.java" />
<batchtest todir="${build.test}" if="testcase">
<fileset dir="${src.test}" includes="**/${testcase}.java"/>
<fail if="tests.failed">Tests failed!</fail>