diff options
author | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2006-08-14 23:00:22 +0000 |
---|---|---|
committer | Mark Donszelmann <Mark.Donszelmann@gmail.com> | 2006-08-14 23:00:22 +0000 |
commit | 95a2fc6f26b8c026cfe6092a672d274f60431a84 (patch) | |
tree | 121ef39e39a1661f18abc49e1754537ea09d7138 /samples/cppunit.ant | |
parent | 7eec12a12e1719c7af99a0e9ed83edd1d2396261 (diff) | |
download | cpptasks-parallel-95a2fc6f26b8c026cfe6092a672d274f60431a84.tar.gz cpptasks-parallel-95a2fc6f26b8c026cfe6092a672d274f60431a84.tar.bz2 cpptasks-parallel-95a2fc6f26b8c026cfe6092a672d274f60431a84.tar.xz cpptasks-parallel-95a2fc6f26b8c026cfe6092a672d274f60431a84.zip |
Latest script
Diffstat (limited to 'samples/cppunit.ant')
-rw-r--r-- | samples/cppunit.ant | 1118 |
1 files changed, 559 insertions, 559 deletions
diff --git a/samples/cppunit.ant b/samples/cppunit.ant index f6b2172..a2441a4 100644 --- a/samples/cppunit.ant +++ b/samples/cppunit.ant @@ -1,559 +1,559 @@ -<?xml version="1.0"?>
-<!--
-
-Copyright 2004 The Ant-Contrib project
-
- Licensed 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
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<project name="cppunit" default="test-all-but-qt">
-
-<property name="base.dir" value="."/>
-<property name="debug" value="true"/>
-<property name="compiler" value="gcc"/>
-<property name="src.dir" location="${base.dir}/src"/>
-<property name="examples.dir" location="${base.dir}/examples"/>
-<property name="build.dir" location="build"/>
-<property name="include.dir" location="${base.dir}/include"/>
-<property name="config.dir" location="${base.dir}/config"/>
-<property name="qt.dir" location="/usr/lib/qt3"/>
-<property name="major" value="1"/>
-<property name="minor" value="9"/>
-<property name="build" value="14"/>
-<!-- specify api="unix" or api="win32" override platform default -->
-<property name="api" value="default"/>
-
-<taskdef resource="cpptasks.tasks"/>
-<typedef resource="cpptasks.types"/>
-
-<target name="usage">
- <echo message="Builds cppunit (http://cppunit.sf.net)."/>
- <echo message="Usage:"/>
- <echo message="ant -f cppunit.ant -Dbase.dir=c:/cppunit-1.9.14"/>
- <echo message=" -Dcompiler=[gcc | msvc | icc | bcc ...]"/>
- <echo message="Status:"/>
- <echo message="test-all will pass for gcc and icc on Linux"/>
- <echo message="test-all-but-qt will pass for gcc on Mac OS/X"/>
- <echo message="test-all-but-qt will pass for msvc on Windows"/>
- <echo message="all-but-qt will pass for bcc but test that divide by zero will fail"/>
- <echo message="test-all-but-qt will pass for gcc and CC on Solaris,"/>
- <echo message="but may be necessary to add /usr/ccs/bin so "ar" may be found and"/>
- <echo message="add the location of libstdc++ to LD_LIBRARY_PATH"/>
-</target>
-
-<!--
- sample versioninfo, targetplatform and distributer to check
- if definitions are processed, not functional at this time
--->
-<versioninfo id="cppunit-version"
- fileversion="1.9.14"
- productversion="1.9.14"
- compatibilityversion="1"
- legalcopyright="Copyright © 1996-2000 by Michael Feathers <mfeathers@objectmentor.com>"
- productname="cppunit"
- companyname="Cppunit project <http://cppunit.sourceforge.net>"
- />
-
-<targetplatform id="winbox" arch="pentium4" osfamily="windows"/>
-
-<distributer id="mydistcc" hosts="192.168.18.101 192.168.18.102" protocol="distcc" user="carnold">
- <map local="c:\" remote="smb://xanadu/c-drive/" remoteseparator="/"/>
-</distributer>
-
-<target name="check-config" depends="init">
- <available property="configure-available"
- file="${base.dir}/configure"/>
- <available property="config-auto-available"
- file="${include.dir}/cppunit/config-auto.h"/>
- <condition property="do-autogen">
- <not>
- <or>
- <isset property="configure-available"/>
- <isset property="is-windows"/>
- </or>
- </not>
- </condition>
- <condition property="do-configure">
- <not>
- <or>
- <isset property="config-auto-available"/>
- <isset property="is-windows"/>
- </or>
- </not>
- </condition>
- <condition property="use-brc">
- <equals arg1="${compiler}" arg2="bcc"/>
- </condition>
-</target>
-
-<target name="run-autogen"
- depends="check-config"
- if="do-autogen">
- <exec dir="${base.dir}" executable="bash">
- <arg value="autogen.sh"/>
- </exec>
-</target>
-
-
-<target name="run-configure"
- depends="run-autogen"
- if="do-configure">
- <exec dir="${base.dir}" executable="bash">
- <arg value="configure"/>
- </exec>
-</target>
-
-<target name="init">
- <mkdir dir="${build.dir}"/>
- <property name="obj.dir" value="${build.dir}/obj"/>
- <mkdir dir="${obj.dir}"/>
- <condition property="is-gcc">
- <or>
- <equals arg1="${compiler}" arg2="gcc"/>
- <equals arg1="${compiler}" arg2="g++"/>
- </or>
- </condition>
- <condition property="is-msvc">
- <or>
- <equals arg1="${compiler}" arg2="msvc"/>
- </or>
- </condition>
- <condition property="is-windows"><os family="windows"/></condition>
- <condition property="is-win32">
- <or>
- <equals arg1="${api}" arg2="win32"/>
- <and>
- <equals arg1="${api}" arg2="default"/>
- <isset property="is-windows"/>
- </and>
- </or>
- </condition>
- <property environment="env"/>
- <!-- in case not set in environment, use an insignificant value -->
- <property name="env.LD_LIBRARY_PATH" value="."/>
-</target>
-
-<target name="clean">
- <delete dir="${build.dir}"/>
-</target>
-
-
-<target name="shared-lib" depends="run-configure">
- <mkdir dir="${obj.dir}/cppunit_shared"/>
- <mkdir dir="${build.dir}/lib"/>
- <cc subsystem="console"
- objdir="${obj.dir}/cppunit_shared"
- debug="${debug}"
- outtype="shared"
- name="${compiler}"
- exceptions="true"
- rtti="true"
- optimize="speed"
- outfile="${build.dir}/lib/cppunit">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${src.dir}/cppunit"
- includes="*.cpp" excludes="DllMain.cpp"/>
- <fileset dir="${src.dir}/cppunit"
- includes="DllMain.cpp"
- if="is-windows"/>
- <includepath path="${include.dir}"/>
- <libset libs="dl" unless="is-win32"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="CPPUNIT_BUILD_DLL"/>
- <defineset define="WIN32" if="is-win32"/>
- <versioninfo extends="cppunit-version" filedescription="Cppunit shared library"/>
- <!-- writes shared-lib.cbx -->
- <project outfile="${base.dir}/shared-lib" type="cbuilderx" name="shared-lib"/>
- <!-- writes cppunit.dsp -->
- <project outfile="${base.dir}/cppunit" type="msvc5" name="cppunit"/>
- <!-- writes cppunit.vcproj -->
- <project outfile="${base.dir}/cppunit" type="msvc71" name="testdllproj"/>
- <!-- writes cppunit.xcode -->
- <project outfile="${base.dir}/cppunit" type="xcode" name="cppunit"/>
- </cc>
-</target>
-
-<target name="static-lib" depends="run-configure">
- <mkdir dir="${obj.dir}/cppunit_static"/>
- <cc subsystem="console"
- outfile="${build.dir}/cppunit"
- objdir="${obj.dir}/cppunit_static"
- outtype="static"
- debug="${debug}"
- exceptions="true"
- rtti="true"
- optimize="speed"
- name="${compiler}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${src.dir}/cppunit"
- includes="*.cpp" excludes="DllMain.cpp"/>
- <includepath path="${include.dir}"/>
- <defineset define="WIN32" if="is-win32"/>
- <libset libs="stdc++" if="is-gcc"/>
- <versioninfo extends="cppunit-version" filedescription="Cppunit static library"/>
- <!-- writes static-lib.cbx -->
- <project outfile="${base.dir}/static-lib" type="cbuilderx" name="static-lib"/>
- <project outfile="${base.dir}/cppunit_static" type="msvc5" name="cppunit"/>
- </cc>
-</target>
-
-<target name="compile-static-test" depends="static-lib">
- <mkdir dir="${obj.dir}/cppunittestmain_static"/>
- <cc outfile="${build.dir}/cppunittestmain_static"
- outtype="executable"
- subsystem="console"
- objdir="${obj.dir}/cppunittestmain_static"
- debug="${debug}"
- exceptions="true"
- rtti="true"
- optimize="speed"
- name="${compiler}"
- outputfileproperty="test-static.exe">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${examples.dir}/cppunittest"
- includes="*.cpp" excludes="CppUnitTestPlugIn.cpp"/>
- <includepath path="${include.dir}"/>
- <libset dir="${build.dir}" libs="cppunit"/>
- <defineset define="WIN32" if="is-win32"/>
- <libset libs="stdc++" if="is-gcc"/>
- <versioninfo extends="cppunit-version" filedescription="Self tests using static library"/>
- <project outfile="${base.dir}/static-test" type="cbuilderx" name="static-test"/>
- <project outfile="${base.dir}/static_test" type="msvc5" name="cppunittestmain"/>
- </cc>
-</target>
-
-<target name="compile-shared-test" depends="shared-lib">
- <mkdir dir="${obj.dir}/cppunittestmain_shared_shared"/>
- <cc outfile="${build.dir}/lib/cppunittestmain_shared"
- outtype="executable"
- subsystem="console"
- objdir="${obj.dir}/cppunittestmain_shared"
- debug="${debug}"
- name="${compiler}"
- exceptions="true"
- rtti="true"
- optimize="speed"
- outputfileproperty="test.exe">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${examples.dir}/cppunittest"
- includes="*.cpp" excludes="CppUnitTestPlugIn.cpp"/>
- <includepath path="${include.dir}"/>
- <libset dir="${build.dir}/lib" libs="cppunit"/>
- <defineset define="CPPUNIT_DLL"/>
- <defineset define="WIN32" if="is-win32"/>
- <libset libs="stdc++" if="is-gcc"/>
- <versioninfo extends="cppunit-version" filedescription="Self tests using shared library"/>
- <project outfile="${base.dir}/shared-test" type="cbuilderx" name="shared-test"/>
- </cc>
-</target>
-
-<!--
-compile CPPUnit implementation and unit tests into a single executable
--->
-<target name="compile-mono-test" depends="run-configure">
- <mkdir dir="${obj.dir}/cppunittestmain_mono"/>
- <cc outfile="${build.dir}/lib/cppunittestmain"
- outtype="executable"
- subsystem="console"
- objdir="${obj.dir}/cppunittestmain_mono"
- debug="${debug}"
- name="${compiler}"
- exceptions="true"
- rtti="true"
- optimize="speed"
- outputfileproperty="test.exe">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${src.dir}/cppunit"
- includes="*.cpp" excludes="DllMain.cpp"/>
- <libset libs="dl" unless="is-win32"/>
- <fileset dir="${examples.dir}/cppunittest"
- includes="*.cpp" excludes="CppUnitTestPlugIn.cpp"/>
- <includepath path="${include.dir}"/>
- <defineset define="WIN32" if="is-win32"/>
- <libset libs="stdc++" if="is-gcc"/>
- <versioninfo extends="cppunit-version" filedescription="Combined unit tests and implementation"/>
- <project outfile="${base.dir}/mono-test" type="cbuilderx" name="cppunittestmain_mono"/>
- </cc>
-</target>
-
-<target name="test-static" depends="compile-static-test">
- <!-- return value (or Ant's treatment of it) is
- inconsistent on Linux -->
- <exec dir="${build.dir}"
- executable="${test-static.exe}"
- failonerror="true"/>
-</target>
-
-<target name="test-shared" depends="compile-shared-test">
- <!-- return value (or Ant's treatment of it) is
- inconsistent on Linux -->
- <exec dir="${build.dir}"
- executable="${build.dir}/lib/cppunittestmain_shared"
- failonerror="true">
- <env key="LD_LIBRARY_PATH" value="${build.dir}/lib:${env.LD_LIBRARY_PATH}"/>
- </exec>
-</target>
-
-<target name="test-mono" depends="compile-mono-test">
- <exec dir="${build.dir}"
- executable="${build.dir}/cppunittestmain"
- failonerror="true"/>
-</target>
-
-<target name="qttestrunner" depends="shared-lib">
- <mkdir dir="${obj.dir}/qttestrunner"/>
- <mkdir dir="${build.dir}/qttestrunner"/>
- <cc outfile="${build.dir}/qttestrunner"
- outtype="shared"
- subsystem="console"
- objdir="${obj.dir}/qttestrunner"
- exceptions="true"
- name="${compiler}"
- rtti="true"
- optimize="speed"
- debug="${debug}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${src.dir}/qttestrunner" includes="*.cpp"/>
- <compiler name="uic">
- <fileset dir="${src.dir}/qttestrunner" includes="*.ui"/>
- </compiler>
- <defineset define="_REENTRANT,QT_NO_DEBUG,QT_THREAD_SUPPORT,QT_SHARED,QT_TABLE_SUPPORT"/>
- <includepath path="${include.dir}"/>
- <includepath path="${obj.dir}/qttestrunner"/>
- <includepath path="${qt.dir}/include"/>
- <libset dir="${build.dir}/lib" libs="cppunit"/>
- <libset dir="${qt.dir}/lib" libs="qt-mt"/>
- <libset libs="pthread"/>
- <libset libs="stdc++" if="is-gcc"/>
- <versioninfo extends="cppunit-version" filedescription="Qt test runner"/>
- </cc>
-
-</target>
-
-<target name="plugintester" depends="static-lib">
- <mkdir dir="${obj.dir}/DllPlugInTester"/>
- <cc outfile="${build.dir}/DllPlugInTester"
- outtype="executable"
- subsystem="console"
- objdir="${obj.dir}/DllPlugInTester"
- exceptions="true"
- rtti="true"
- optimize="speed"
- name="${compiler}"
- debug="${debug}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${src.dir}/DllPlugInTester"
- includes="*.cpp"
- excludes="DllPlugInTesterTest.cpp"/>
- <includepath path="${include.dir}"/>
- <libset dir="${build.dir}" libs="cppunit"/>
- <libset libs="dl" unless="is-windows"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="WIN32" if="is-windows"/>
- <versioninfo extends="cppunit-version" fileversion="Dll Plug-in tester"/>
- </cc>
-</target>
-
-
-<target name="plugintestertest" depends="plugintester">
- <mkdir dir="${obj.dir}/DllPlugInTester"/>
- <cc outfile="${build.dir}/DllPlugInTesterTest"
- outtype="executable"
- subsystem="console"
- objdir="${obj.dir}/DllPlugInTester"
- name="${compiler}"
- exceptions="true"
- optimize="speed"
- rtti="true"
- debug="${debug}">
- <fileset dir="${src.dir}/DllPlugInTester"
- includes="*.cpp"
- excludes="DllPlugInTester.cpp"/>
- <includepath path="${include.dir}"/>
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <libset dir="${build.dir}" libs="cppunit"/>
- <libset libs="dl" unless="is-windows"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="WIN32" if="is-windows"/>
- <versioninfo extends="cppunit-version" filedescription="Tests for Plugin tester"/>
- </cc>
-</target>
-
-<target name="test-plugintestertest" depends="plugintestertest">
- <exec executable="${build.dir}/DllPlugInTesterTest"/>
-</target>
-
-<target name="money" depends="static-lib">
- <mkdir dir="${obj.dir}/money"/>
- <cc outfile="${build.dir}/MoneyApp"
- outtype="executable"
- subsystem="console"
- name="${compiler}"
- objdir="${obj.dir}/money"
- exceptions="true"
- rtti="true"
- optimize="speed"
- debug="${debug}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${examples.dir}/money"
- includes="*.cpp"/>
- <includepath path="${include.dir}"/>
- <libset dir="${build.dir}" libs="cppunit"/>
- <libset libs="dl" unless="is-windows"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="WIN32" if="is-win32"/>
- <versioninfo extends="cppunit-version" filedescription="Money example"/>
- </cc>
-</target>
-
-<target name="test-money" depends="money">
- <exec executable="${build.dir}/MoneyApp"
- failonerror="true"/>
-</target>
-
-<target name="hierarchy" depends="static-lib">
- <mkdir dir="${obj.dir}/hierarchy"/>
- <cc outfile="${build.dir}/hierarchy"
- outtype="executable"
- subsystem="console"
- name="${compiler}"
- objdir="${obj.dir}/hierarchy"
- exceptions="true"
- rtti="true"
- optimize="speed"
- debug="${debug}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${examples.dir}/hierarchy"
- includes="*.cpp"/>
- <includepath path="${include.dir}"/>
- <libset dir="${build.dir}" libs="cppunit"/>
- <libset libs="dl" unless="is-windows"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="WIN32" if="is-win32"/>
- <versioninfo extends="cppunit-version" filedescription="Hierarchy example"/>
- </cc>
-</target>
-
-<target name="test-hierarchy" depends="hierarchy">
- <!-- some tests intentionally fail -->
- <exec executable="${build.dir}/hierarchy"
- resultproperty="hierarchy-result"/>
- <condition property="hierarchy-pass">
- <equals arg1="${hierarchy-result}" arg2="0"/>
- </condition>
- <fail unless="hierarchy-pass"
- message="hierarchy erroneously passed all tests"/>
-</target>
-
-<target name="simple" depends="static-lib">
- <mkdir dir="${obj.dir}/simple"/>
- <cc outfile="${build.dir}/simple"
- outtype="executable"
- subsystem="console"
- name="${compiler}"
- exceptions="true"
- optimize="speed"
- rtti="true"
- objdir="${obj.dir}/simple"
- debug="${debug}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${examples.dir}/simple"
- includes="*.cpp" excludes="SimplePlugIn.cpp"/>
- <includepath path="${include.dir}"/>
- <!-- original was shared, but changing gives
- an error loading library -->
- <libset dir="${build.dir}" libs="cppunit"/>
- <libset libs="dl" unless="is-windows"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="WIN32" if="is-win32"/>
- <versioninfo extends="cppunit-version" filedescription="Sample plug-in"/>
- </cc>
-</target>
-
-<target name="test-simple" depends="simple">
- <!-- some tests intentionally fail -->
- <exec executable="${build.dir}/simple"
- resultproperty="simple-result"/>
- <condition property="simple-pass">
- <equals arg1="${simple-result}" arg2="0"/>
- </condition>
- <!-- fail unless="simple-pass"
- message="simple erroneously passed all tests"/ -->
-</target>
-
-<target name="dsplugin" depends="static-lib" if="is-windows">
- <mkdir dir="${obj.dir}/DSPlugIn"/>
- <!-- DSPlugIn.rc required compiled tlb to be in same directory -->
- <cc objdir="${src.dir}/msvc6/DSPlugIn"
- name="midl">
- <fileset dir="${src.dir}/msvc6/DSPlugIn" includes="*.idl"/>
- </cc>
- <cc outfile="${build.dir}/TestRunnerDSPlugIn"
- outtype="shared"
- subsystem="gui"
- objdir="${obj.dir}/DSPlugIn"
- exceptions="true"
- name="${compiler}"
- optimize="speed"
- rtti="true"
- debug="${debug}">
- <compiler name="brc" if="use-brc"/>
- <compiler name="msrc"/>
- <fileset dir="${src.dir}/msvc6/DSPlugIn"
- includes="*.cpp *.rc"/>
- <compiler name="msrc"/>
- <includepath path="${include.dir}"/>
- <libset dir="${build.dir}" libs="cppunit"/>
- <libset libs="stdc++" if="is-gcc"/>
- <defineset define="WIN32" if="is-win32"/>
- <versioninfo refid="cppunit-version"/>
- </cc>
-</target>
-
-
-
-<target name="all-static" depends="static-lib,
- plugintestertest,
- money,
- hierarchy,
- simple"/>
-
-<target name="test-all-static" depends="test-static,
- test-plugintestertest,
- test-money,
- test-hierarchy,
- test-simple"/>
-
-<target name="all-but-qt" depends="shared-lib,all-static"/>
-
-<target name="test-all-but-qt" depends="test-shared,test-all-static"/>
-
-<target name="all-qt" depends="qttestrunner"/>
-
-<target name="test-all-qt" depends="qttestrunner"/>
-
-<target name="all" depends="all-but-qt, all-qt"/>
-
-<target name="test-all" depends="test-all-but-qt, test-all-qt"/>
-
-</project>
+<?xml version="1.0"?> +<!-- + +Copyright 2004 The Ant-Contrib project + + Licensed 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 + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project name="cppunit" default="test-all-but-qt"> + +<property name="base.dir" value="."/> +<property name="debug" value="true"/> +<property name="compiler" value="gcc"/> +<property name="src.dir" location="${base.dir}/src"/> +<property name="examples.dir" location="${base.dir}/examples"/> +<property name="build.dir" location="build"/> +<property name="include.dir" location="${base.dir}/include"/> +<property name="config.dir" location="${base.dir}/config"/> +<property name="qt.dir" location="/usr/lib/qt3"/> +<property name="major" value="1"/> +<property name="minor" value="9"/> +<property name="build" value="14"/> +<!-- specify api="unix" or api="win32" override platform default --> +<property name="api" value="default"/> + +<taskdef resource="cpptasks.tasks"/> +<typedef resource="cpptasks.types"/> + +<target name="usage"> + <echo message="Builds cppunit (http://cppunit.sf.net)."/> + <echo message="Usage:"/> + <echo message="ant -f cppunit.ant -Dbase.dir=c:/cppunit-1.9.14"/> + <echo message=" -Dcompiler=[gcc | msvc | icc | bcc ...]"/> + <echo message="Status:"/> + <echo message="test-all will pass for gcc and icc on Linux"/> + <echo message="test-all-but-qt will pass for gcc on Mac OS/X"/> + <echo message="test-all-but-qt will pass for msvc on Windows"/> + <echo message="all-but-qt will pass for bcc but test that divide by zero will fail"/> + <echo message="test-all-but-qt will pass for gcc and CC on Solaris,"/> + <echo message="but may be necessary to add /usr/ccs/bin so "ar" may be found and"/> + <echo message="add the location of libstdc++ to LD_LIBRARY_PATH"/> +</target> + +<!-- + sample versioninfo, targetplatform and distributer to check + if definitions are processed, not functional at this time +--> +<versioninfo id="cppunit-version" + fileversion="1.9.14" + productversion="1.9.14" + compatibilityversion="1" + legalcopyright="Copyright © 1996-2000 by Michael Feathers <mfeathers@objectmentor.com>" + productname="cppunit" + companyname="Cppunit project <http://cppunit.sourceforge.net>" + /> + +<targetplatform id="winbox" arch="pentium4" osfamily="windows"/> + +<distributer id="mydistcc" hosts="192.168.18.101 192.168.18.102" protocol="distcc" user="carnold"> + <map local="c:\" remote="smb://xanadu/c-drive/" remoteseparator="/"/> +</distributer> + +<target name="check-config" depends="init"> + <available property="configure-available" + file="${base.dir}/configure"/> + <available property="config-auto-available" + file="${include.dir}/cppunit/config-auto.h"/> + <condition property="do-autogen"> + <not> + <or> + <isset property="configure-available"/> + <isset property="is-windows"/> + </or> + </not> + </condition> + <condition property="do-configure"> + <not> + <or> + <isset property="config-auto-available"/> + <isset property="is-windows"/> + </or> + </not> + </condition> + <condition property="use-brc"> + <equals arg1="${compiler}" arg2="bcc"/> + </condition> +</target> + +<target name="run-autogen" + depends="check-config" + if="do-autogen"> + <exec dir="${base.dir}" executable="bash"> + <arg value="autogen.sh"/> + </exec> +</target> + + +<target name="run-configure" + depends="run-autogen" + if="do-configure"> + <exec dir="${base.dir}" executable="bash"> + <arg value="configure"/> + </exec> +</target> + +<target name="init"> + <mkdir dir="${build.dir}"/> + <property name="obj.dir" value="${build.dir}/obj"/> + <mkdir dir="${obj.dir}"/> + <condition property="is-gcc"> + <or> + <equals arg1="${compiler}" arg2="gcc"/> + <equals arg1="${compiler}" arg2="g++"/> + </or> + </condition> + <condition property="is-msvc"> + <or> + <equals arg1="${compiler}" arg2="msvc"/> + </or> + </condition> + <condition property="is-windows"><os family="windows"/></condition> + <condition property="is-win32"> + <or> + <equals arg1="${api}" arg2="win32"/> + <and> + <equals arg1="${api}" arg2="default"/> + <isset property="is-windows"/> + </and> + </or> + </condition> + <property environment="env"/> + <!-- in case not set in environment, use an insignificant value --> + <property name="env.LD_LIBRARY_PATH" value="."/> +</target> + +<target name="clean"> + <delete dir="${build.dir}"/> +</target> + + +<target name="shared-lib" depends="run-configure"> + <mkdir dir="${obj.dir}/cppunit_shared"/> + <mkdir dir="${build.dir}/lib"/> + <cc subsystem="console" + objdir="${obj.dir}/cppunit_shared" + debug="${debug}" + outtype="shared" + name="${compiler}" + exceptions="true" + rtti="true" + optimize="speed" + outfile="${build.dir}/lib/cppunit"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${src.dir}/cppunit" + includes="*.cpp" excludes="DllMain.cpp"/> + <fileset dir="${src.dir}/cppunit" + includes="DllMain.cpp" + if="is-windows"/> + <includepath path="${include.dir}"/> + <libset libs="dl" unless="is-win32"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="CPPUNIT_BUILD_DLL"/> + <defineset define="WIN32" if="is-win32"/> + <versioninfo extends="cppunit-version" filedescription="Cppunit shared library"/> + <!-- writes shared-lib.cbx --> + <project outfile="${base.dir}/shared-lib" type="cbuilderx" name="shared-lib"/> + <!-- writes cppunit.dsp --> + <project outfile="${base.dir}/cppunit" type="msvc5" name="cppunit"/> + <!-- writes cppunit.vcproj --> + <project outfile="${base.dir}/cppunit" type="msvc71" name="testdllproj"/> + <!-- writes cppunit.xcode --> + <project outfile="${base.dir}/cppunit" type="xcode" name="cppunit"/> + </cc> +</target> + +<target name="static-lib" depends="run-configure"> + <mkdir dir="${obj.dir}/cppunit_static"/> + <cc subsystem="console" + outfile="${build.dir}/cppunit" + objdir="${obj.dir}/cppunit_static" + outtype="static" + debug="${debug}" + exceptions="true" + rtti="true" + optimize="speed" + name="${compiler}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${src.dir}/cppunit" + includes="*.cpp" excludes="DllMain.cpp"/> + <includepath path="${include.dir}"/> + <defineset define="WIN32" if="is-win32"/> + <libset libs="stdc++" if="is-gcc"/> + <versioninfo extends="cppunit-version" filedescription="Cppunit static library"/> + <!-- writes static-lib.cbx --> + <project outfile="${base.dir}/static-lib" type="cbuilderx" name="static-lib"/> + <project outfile="${base.dir}/cppunit_static" type="msvc5" name="cppunit"/> + </cc> +</target> + +<target name="compile-static-test" depends="static-lib"> + <mkdir dir="${obj.dir}/cppunittestmain_static"/> + <cc outfile="${build.dir}/cppunittestmain_static" + outtype="executable" + subsystem="console" + objdir="${obj.dir}/cppunittestmain_static" + debug="${debug}" + exceptions="true" + rtti="true" + optimize="speed" + name="${compiler}" + outputfileproperty="test-static.exe"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${examples.dir}/cppunittest" + includes="*.cpp" excludes="CppUnitTestPlugIn.cpp"/> + <includepath path="${include.dir}"/> + <libset dir="${build.dir}" libs="cppunit"/> + <defineset define="WIN32" if="is-win32"/> + <libset libs="stdc++" if="is-gcc"/> + <versioninfo extends="cppunit-version" filedescription="Self tests using static library"/> + <project outfile="${base.dir}/static-test" type="cbuilderx" name="static-test"/> + <project outfile="${base.dir}/static_test" type="msvc5" name="cppunittestmain"/> + </cc> +</target> + +<target name="compile-shared-test" depends="shared-lib"> + <mkdir dir="${obj.dir}/cppunittestmain_shared_shared"/> + <cc outfile="${build.dir}/lib/cppunittestmain_shared" + outtype="executable" + subsystem="console" + objdir="${obj.dir}/cppunittestmain_shared" + debug="${debug}" + name="${compiler}" + exceptions="true" + rtti="true" + optimize="speed" + outputfileproperty="test.exe"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${examples.dir}/cppunittest" + includes="*.cpp" excludes="CppUnitTestPlugIn.cpp"/> + <includepath path="${include.dir}"/> + <libset dir="${build.dir}/lib" libs="cppunit"/> + <defineset define="CPPUNIT_DLL"/> + <defineset define="WIN32" if="is-win32"/> + <libset libs="stdc++" if="is-gcc"/> + <versioninfo extends="cppunit-version" filedescription="Self tests using shared library"/> + <project outfile="${base.dir}/shared-test" type="cbuilderx" name="shared-test"/> + </cc> +</target> + +<!-- +compile CPPUnit implementation and unit tests into a single executable +--> +<target name="compile-mono-test" depends="run-configure"> + <mkdir dir="${obj.dir}/cppunittestmain_mono"/> + <cc outfile="${build.dir}/lib/cppunittestmain" + outtype="executable" + subsystem="console" + objdir="${obj.dir}/cppunittestmain_mono" + debug="${debug}" + name="${compiler}" + exceptions="true" + rtti="true" + optimize="speed" + outputfileproperty="test.exe"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${src.dir}/cppunit" + includes="*.cpp" excludes="DllMain.cpp"/> + <libset libs="dl" unless="is-win32"/> + <fileset dir="${examples.dir}/cppunittest" + includes="*.cpp" excludes="CppUnitTestPlugIn.cpp"/> + <includepath path="${include.dir}"/> + <defineset define="WIN32" if="is-win32"/> + <libset libs="stdc++" if="is-gcc"/> + <versioninfo extends="cppunit-version" filedescription="Combined unit tests and implementation"/> + <project outfile="${base.dir}/mono-test" type="cbuilderx" name="cppunittestmain_mono"/> + </cc> +</target> + +<target name="test-static" depends="compile-static-test"> + <!-- return value (or Ant's treatment of it) is + inconsistent on Linux --> + <exec dir="${build.dir}" + executable="${test-static.exe}" + failonerror="true"/> +</target> + +<target name="test-shared" depends="compile-shared-test"> + <!-- return value (or Ant's treatment of it) is + inconsistent on Linux --> + <exec dir="${build.dir}" + executable="${build.dir}/lib/cppunittestmain_shared" + failonerror="true"> + <env key="LD_LIBRARY_PATH" value="${build.dir}/lib:${env.LD_LIBRARY_PATH}"/> + </exec> +</target> + +<target name="test-mono" depends="compile-mono-test"> + <exec dir="${build.dir}" + executable="${build.dir}/cppunittestmain" + failonerror="true"/> +</target> + +<target name="qttestrunner" depends="shared-lib"> + <mkdir dir="${obj.dir}/qttestrunner"/> + <mkdir dir="${build.dir}/qttestrunner"/> + <cc outfile="${build.dir}/qttestrunner" + outtype="shared" + subsystem="console" + objdir="${obj.dir}/qttestrunner" + exceptions="true" + name="${compiler}" + rtti="true" + optimize="speed" + debug="${debug}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${src.dir}/qttestrunner" includes="*.cpp"/> + <compiler name="uic"> + <fileset dir="${src.dir}/qttestrunner" includes="*.ui"/> + </compiler> + <defineset define="_REENTRANT,QT_NO_DEBUG,QT_THREAD_SUPPORT,QT_SHARED,QT_TABLE_SUPPORT"/> + <includepath path="${include.dir}"/> + <includepath path="${obj.dir}/qttestrunner"/> + <includepath path="${qt.dir}/include"/> + <libset dir="${build.dir}/lib" libs="cppunit"/> + <libset dir="${qt.dir}/lib" libs="qt-mt"/> + <libset libs="pthread"/> + <libset libs="stdc++" if="is-gcc"/> + <versioninfo extends="cppunit-version" filedescription="Qt test runner"/> + </cc> + +</target> + +<target name="plugintester" depends="static-lib"> + <mkdir dir="${obj.dir}/DllPlugInTester"/> + <cc outfile="${build.dir}/DllPlugInTester" + outtype="executable" + subsystem="console" + objdir="${obj.dir}/DllPlugInTester" + exceptions="true" + rtti="true" + optimize="speed" + name="${compiler}" + debug="${debug}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${src.dir}/DllPlugInTester" + includes="*.cpp" + excludes="DllPlugInTesterTest.cpp"/> + <includepath path="${include.dir}"/> + <libset dir="${build.dir}" libs="cppunit"/> + <libset libs="dl" unless="is-windows"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="WIN32" if="is-windows"/> + <versioninfo extends="cppunit-version" fileversion="Dll Plug-in tester"/> + </cc> +</target> + + +<target name="plugintestertest" depends="plugintester"> + <mkdir dir="${obj.dir}/DllPlugInTester"/> + <cc outfile="${build.dir}/DllPlugInTesterTest" + outtype="executable" + subsystem="console" + objdir="${obj.dir}/DllPlugInTester" + name="${compiler}" + exceptions="true" + optimize="speed" + rtti="true" + debug="${debug}"> + <fileset dir="${src.dir}/DllPlugInTester" + includes="*.cpp" + excludes="DllPlugInTester.cpp"/> + <includepath path="${include.dir}"/> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <libset dir="${build.dir}" libs="cppunit"/> + <libset libs="dl" unless="is-windows"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="WIN32" if="is-windows"/> + <versioninfo extends="cppunit-version" filedescription="Tests for Plugin tester"/> + </cc> +</target> + +<target name="test-plugintestertest" depends="plugintestertest"> + <exec executable="${build.dir}/DllPlugInTesterTest"/> +</target> + +<target name="money" depends="static-lib"> + <mkdir dir="${obj.dir}/money"/> + <cc outfile="${build.dir}/MoneyApp" + outtype="executable" + subsystem="console" + name="${compiler}" + objdir="${obj.dir}/money" + exceptions="true" + rtti="true" + optimize="speed" + debug="${debug}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${examples.dir}/money" + includes="*.cpp"/> + <includepath path="${include.dir}"/> + <libset dir="${build.dir}" libs="cppunit"/> + <libset libs="dl" unless="is-windows"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="WIN32" if="is-win32"/> + <versioninfo extends="cppunit-version" filedescription="Money example"/> + </cc> +</target> + +<target name="test-money" depends="money"> + <exec executable="${build.dir}/MoneyApp" + failonerror="true"/> +</target> + +<target name="hierarchy" depends="static-lib"> + <mkdir dir="${obj.dir}/hierarchy"/> + <cc outfile="${build.dir}/hierarchy" + outtype="executable" + subsystem="console" + name="${compiler}" + objdir="${obj.dir}/hierarchy" + exceptions="true" + rtti="true" + optimize="speed" + debug="${debug}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${examples.dir}/hierarchy" + includes="*.cpp"/> + <includepath path="${include.dir}"/> + <libset dir="${build.dir}" libs="cppunit"/> + <libset libs="dl" unless="is-windows"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="WIN32" if="is-win32"/> + <versioninfo extends="cppunit-version" filedescription="Hierarchy example"/> + </cc> +</target> + +<target name="test-hierarchy" depends="hierarchy"> + <!-- some tests intentionally fail --> + <exec executable="${build.dir}/hierarchy" + resultproperty="hierarchy-result"/> + <condition property="hierarchy-pass"> + <equals arg1="${hierarchy-result}" arg2="0"/> + </condition> + <fail unless="hierarchy-pass" + message="hierarchy erroneously passed all tests"/> +</target> + +<target name="simple" depends="static-lib"> + <mkdir dir="${obj.dir}/simple"/> + <cc outfile="${build.dir}/simple" + outtype="executable" + subsystem="console" + name="${compiler}" + exceptions="true" + optimize="speed" + rtti="true" + objdir="${obj.dir}/simple" + debug="${debug}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${examples.dir}/simple" + includes="*.cpp" excludes="SimplePlugIn.cpp"/> + <includepath path="${include.dir}"/> + <!-- original was shared, but changing gives + an error loading library --> + <libset dir="${build.dir}" libs="cppunit"/> + <libset libs="dl" unless="is-windows"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="WIN32" if="is-win32"/> + <versioninfo extends="cppunit-version" filedescription="Sample plug-in"/> + </cc> +</target> + +<target name="test-simple" depends="simple"> + <!-- some tests intentionally fail --> + <exec executable="${build.dir}/simple" + resultproperty="simple-result"/> + <condition property="simple-pass"> + <equals arg1="${simple-result}" arg2="0"/> + </condition> + <!-- fail unless="simple-pass" + message="simple erroneously passed all tests"/ --> +</target> + +<target name="dsplugin" depends="static-lib" if="is-windows"> + <mkdir dir="${obj.dir}/DSPlugIn"/> + <!-- DSPlugIn.rc required compiled tlb to be in same directory --> + <cc objdir="${src.dir}/msvc6/DSPlugIn" + name="midl"> + <fileset dir="${src.dir}/msvc6/DSPlugIn" includes="*.idl"/> + </cc> + <cc outfile="${build.dir}/TestRunnerDSPlugIn" + outtype="shared" + subsystem="gui" + objdir="${obj.dir}/DSPlugIn" + exceptions="true" + name="${compiler}" + optimize="speed" + rtti="true" + debug="${debug}"> + <compiler name="brc" if="use-brc"/> + <compiler name="msrc"/> + <fileset dir="${src.dir}/msvc6/DSPlugIn" + includes="*.cpp *.rc"/> + <compiler name="msrc"/> + <includepath path="${include.dir}"/> + <libset dir="${build.dir}" libs="cppunit"/> + <libset libs="stdc++" if="is-gcc"/> + <defineset define="WIN32" if="is-win32"/> + <versioninfo refid="cppunit-version"/> + </cc> +</target> + + + +<target name="all-static" depends="static-lib, + plugintestertest, + money, + hierarchy, + simple"/> + +<target name="test-all-static" depends="test-static, + test-plugintestertest, + test-money, + test-hierarchy, + test-simple"/> + +<target name="all-but-qt" depends="shared-lib,all-static"/> + +<target name="test-all-but-qt" depends="test-shared,test-all-static"/> + +<target name="all-qt" depends="qttestrunner"/> + +<target name="test-all-qt" depends="qttestrunner"/> + +<target name="all" depends="all-but-qt, all-qt"/> + +<target name="test-all" depends="test-all-but-qt, test-all-qt"/> + +</project> |