343 lines
18 KiB
Text
343 lines
18 KiB
Text
<?xml version = "1.0" encoding="UTF-8"?>
|
|
|
|
<project name = "Gear">
|
|
|
|
<setenv name="BEAST_HOME" dir="../private/tools/Beast" />
|
|
|
|
<!-- create targetname property if none is specified -->
|
|
<if test = "${not property::exists('targetname')}">
|
|
<property name = "targetname" value = "gear_tests" />
|
|
</if>
|
|
|
|
<!-- targetconfig alias -->
|
|
<if test = "${property::exists('config')}">
|
|
<property name = "targetconfig" value = "${config}" />
|
|
</if>
|
|
|
|
<!-- artifactsuffix : D for Debug, R for Release and nothing for Retail (and DLL* for DLL configs) -->
|
|
<property name = "artifactsuffix" value = "DLL" />
|
|
<if test = "${string::contains(property::get-value('targetconfig'),'Debug') == true}" >
|
|
<property name = "artifactsuffix" value = "DLLD" />
|
|
</if>
|
|
<if test = "${string::contains(property::get-value('targetconfig'),'Release') == true}" >
|
|
<property name = "artifactsuffix" value = "DLLR" />
|
|
</if>
|
|
<if test = "${string::contains(property::get-value('targetconfig'),'DLL') == false}" >
|
|
<property name = "artifactsuffix" value = "${string::replace(property::get-value('artifactsuffix'), 'DLL', '')}" />
|
|
</if>
|
|
<if test = "${platform == 'android'}" >
|
|
<property name = "artifactsuffix" value = "-debug" />
|
|
</if>
|
|
|
|
<!-- create modulelist property with default values if none is specified -->
|
|
<property name = "__modulelist" value = "gear_core gear_detection gear_testing" />
|
|
<if test = "${property::exists('modulelist')}">
|
|
<property name = "__modulelist" value = "${modulelist}" />
|
|
</if>
|
|
|
|
<if test = "${property::get-value('platform') != 'win32' and property::get-value('platform') != 'win64' }">
|
|
<property name = "__modulelist" value = "${string::replace(property::get-value('__modulelist'), ' gear_detection', '')}" />
|
|
</if>
|
|
|
|
<!-- setting timeout depending on ${platform} and 'runperftest' property -->
|
|
<property name = "timeout" value = "1800" />
|
|
<if test = "${platform == 'ps3'}" >
|
|
<property name = "timeout" value = "7200" />
|
|
</if>
|
|
<if test = "${platform == 'xenon'}" >
|
|
<property name = "timeout" value = "7200" />
|
|
</if>
|
|
<!-- Buff up timeout if we are running perftests -->
|
|
<if test = "${property::exists('runperftest') and property::get-value('runperftest') == 'true'}">
|
|
<property name = "timeout" value = "3600" />
|
|
</if>
|
|
|
|
<!-- setting path to python installation -->
|
|
<!-- sync python folder -->
|
|
<property name="PYTHON_DIR" value="..\private\tools\Python27"/>
|
|
<property name="PYTHON" value="${PYTHON_DIR}\python"/>
|
|
<if test = "${platform == 'linux'}" >
|
|
<property name="PYTHON_DIR" value="../private/tools/Python27_linux/bin"/>
|
|
<property name="PYTHON" value="${PYTHON_DIR}/python"/>
|
|
</if>
|
|
<if test = "${platform == 'mac' or platform == 'ios'}" >
|
|
<property name="PYTHON_DIR" value="/usr/bin"/>
|
|
<property name="PYTHON" value="${PYTHON_DIR}/python"/>
|
|
</if>
|
|
|
|
<!-- setting binextension depending on ${platform} -->
|
|
<property name = "binextension" value = ".exe" />
|
|
<if test = "${platform == 'ps3'}" >
|
|
<property name = "binextension" value = ".self" />
|
|
</if>
|
|
<if test = "${platform == 'vita'}" >
|
|
<property name = "binextension" value = ".self" />
|
|
</if>
|
|
<if test = "${platform == 'orbis'}" >
|
|
<property name = "binextension" value = ".elf" />
|
|
</if>
|
|
<if test = "${platform == 'cafe'}" >
|
|
<property name = "binextension" value = ".rpx" />
|
|
</if>
|
|
<if test = "${platform == 'linux'}" >
|
|
<property name = "binextension" value = "" />
|
|
</if>
|
|
<if test = "${platform == 'android'}" >
|
|
<property name = "binextension" value = ".apk" />
|
|
</if>
|
|
<if test = "${platform == 'mac'}" >
|
|
<property name = "binextension" value = "" />
|
|
</if>
|
|
<if test = "${platform == 'ios'}" >
|
|
<property name = "binextension" value = "" />
|
|
</if>
|
|
|
|
<!-- this is only there to deal with ps3 special cases -->
|
|
<property name = "platformsuffix" value = "" />
|
|
<if test = "${platform == 'ps3'}" >
|
|
<property name = "platformsuffix" value = "_ppu" />
|
|
</if>
|
|
|
|
<!-- default filename for the zip. It needs to be overwritten by the build system -->
|
|
<property name = "zipfilename"
|
|
value = "gear_${platform}${platformsuffix}_${targetconfig}.zip"
|
|
unless = "${property::exists('zipfilename')}" />
|
|
|
|
<!-- failure strings depends on platform -->
|
|
<property name = "failurestring" value = "" />
|
|
<if test = "${platform == 'mac'}">
|
|
<property name = "failurestring" value = "attempted to access invalid address;Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'ios'}">
|
|
<property name = "failurestring" value = "attempted to access invalid address;Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'vita'}">
|
|
<property name = "failurestring" value = "Print Backtrace(User stack);abort() is called.;Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'xenon'}">
|
|
<property name = "failurestring" value = "VD: Time out in VdBlockUntilGUIIdle;XBox stopped!;Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'ps3'}">
|
|
<property name = "failurestring" value = "The SPU exception occurred on the;Lv-2 detected an interrupt(exception) in a user PPU Thread;Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'cafe'}">
|
|
<property name = "failurestring" value = "--GQRs----------;Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'win32'}">
|
|
<property name = "failurestring" value = "Memory leak detected!" />
|
|
</if>
|
|
<if test = "${platform == 'win64'}">
|
|
<property name = "failurestring" value = "Memory leak detected!" />
|
|
</if>
|
|
|
|
<!-- the manifest destination is required for xenon -->
|
|
<property name = "manifestdestination" value = "" />
|
|
<if test = "${platform == 'xenon'}" >
|
|
<property name = "manifestdestination" value = "xe:/testsuite" />
|
|
</if>
|
|
|
|
<include buildfile = "${environment::get-variable('BEAST_HOME')}/Beast.build" />
|
|
|
|
<!-- By default, we exclude all test that takes a long time to run. -->
|
|
<if test = "${not property::exists('manifestArgs')}">
|
|
<property name = "manifestArgs" value = "--gtest_filter=-*perf_* --g4_spuelfs_path=${Main.BaseLocation}/buildfolder/nant-test/" if = "${platform == 'ps3'}" />
|
|
<property name = "manifestArgs" value = "--gtest_filter=-*perf_*" if = "${platform != 'ps3'}" />
|
|
<!-- Add "perf_" if we are running perftests -->
|
|
<if test = "${property::exists('runperftest') and property::get-value('runperftest') == 'true'}">
|
|
<property name = "manifestArgs" value = "--gtest_filter=*perf_* --g4_spuelfs_path=${Main.BaseLocation}/buildfolder/nant-test/" if = "${platform == 'ps3'}" />
|
|
<property name = "manifestArgs" value = "--gtest_filter=*perf_*" if = "${platform != 'ps3'}" />
|
|
</if>
|
|
</if>
|
|
|
|
<!-- ************************************************************************************************ -->
|
|
<!-- * This target cleans all the SPUs ELFs forcing a rebuild on every SPU tests. * -->
|
|
<!-- ************************************************************************************************ -->
|
|
<target name = "CleanSPU">
|
|
<if test = "${platform == 'ps3'}">
|
|
<delete>
|
|
<fileset>
|
|
<include name = "${Main.BaseLocation}/gear_core/projects/ps3/**/test_*.elf" />
|
|
</fileset>
|
|
</delete>
|
|
</if>
|
|
</target>
|
|
|
|
<!-- ************************************************************************************************ -->
|
|
<!-- * if bullseye is installed, make sure it's deactivated unless bullseye property is set to true * -->
|
|
<!-- ************************************************************************************************ -->
|
|
<target name = "BullseyePreBuild">
|
|
<if test = "${string::contains(environment::get-variable('PATH'), 'BullseyeCoverage') == true}">
|
|
<echo message = "Bullseye is installed on this machine." />
|
|
<choose>
|
|
<when test = "${property::exists('bullseye') and property::get-value('bullseye') == 'true'}" >
|
|
|
|
<setenv name = "COVFILE" dir = "${directory::get-current-directory()}/bullseye/${Target.name}_test.cov" />
|
|
|
|
<!-- turn bullseye on -->
|
|
<echo message = "bullseye property is set to true, turning Bullseye on..." />
|
|
<exec program = "cmd" workingdir = "." commandline = "/c cov01 --on" verbose = "true"/>
|
|
|
|
<!-- check out cov file and clean it -->
|
|
<echo message = "cheking out cov file and clean it..." />
|
|
<exec program = "p4.exe" commandline = "-c ${project.perforceclient} edit ${environment::get-variable('COVFILE')}" verbose = 'true' />
|
|
<delete file = "${environment::get-variable('COVFILE')}" verbose = "true" />
|
|
|
|
<!-- import exclusions -->
|
|
<exec
|
|
program = "cmd"
|
|
workingdir = "."
|
|
commandline = "/c covselect -f${environment::get-variable('COVFILE')} -i BullseyeExclusions"
|
|
verbose = "true"/>
|
|
</when>
|
|
<otherwise>
|
|
<echo message = "bullseye property not found or set to false, turning Bullseye off..." />
|
|
<exec program = "cmd" workingdir = "." commandline = "/c cov01 --off" verbose = "true"/>
|
|
</otherwise>
|
|
</choose>
|
|
</if>
|
|
</target>
|
|
|
|
<!-- ************************************************************************************************ -->
|
|
<!-- * deactivate bullseye if it's installed on the machine * -->
|
|
<!-- ************************************************************************************************ -->
|
|
<target name = "BullseyePostBuild">
|
|
<if test = "${string::contains(environment::get-variable('PATH'), 'BullseyeCoverage') == true}">
|
|
<exec program = "cmd" workingdir = "." commandline = "/c cov01 --off" verbose = "true"/>
|
|
</if>
|
|
</target>
|
|
|
|
<!-- ************************************************************************************************ -->
|
|
<!-- * Submit coverage files from bullseye folder in perforce if perforce operations are enable * -->
|
|
<!-- ************************************************************************************************ -->
|
|
<target name = "BullseyePostTest">
|
|
<if test = "${string::contains(environment::get-variable('PATH'), 'BullseyeCoverage') == true}">
|
|
<if test = "${property::exists('p4operations') and property::get-value('p4operations') == 'true'}">
|
|
|
|
<echo message = "perforce operation enabled." />
|
|
|
|
<!-- setup p4 -->
|
|
<exec program = "p4.exe" commandline = "set P4USER=guest" verbose = 'true'/>
|
|
<if test = "${property::exists('project.perforceclient')}">
|
|
<exec program = "p4.exe" commandline = "set P4CLIENT=${project.perforceclient}" verbose = 'true'/>
|
|
</if>
|
|
<if test = "${property::exists('project.perforceinstance')}">
|
|
<exec program = "p4.exe" commandline = "set P4PORT=${project.perforceinstance}" verbose = 'true'/>
|
|
</if>
|
|
|
|
<!-- revert all unchanged, create changelist description and submit -->
|
|
<exec program = "p4.exe" commandline = "revert -a" verbose = 'true'/>
|
|
|
|
<!-- determine if cov file is still opened for edit -->
|
|
<exec program = "p4.exe" commandline = "opened" verbose = 'true' output = "p4.out"/>
|
|
<regexmatch file = "p4.out" regex = "[\.cov|\.xml].+edit default change" prefix = "match" />
|
|
|
|
<choose>
|
|
<when test = "${property::exists('match_0')}">
|
|
<echo message = "submitting cov file..." />
|
|
<exec program = "p4.exe" commandline = "change -o" output = "p4change.txt" verbose = 'true'/>
|
|
<SearchAndReplaceInFile sourcefile = "p4change.txt" tofind = "<enter description here>" toreplacewith = "@skipped@ Update Coverage File" />
|
|
<exec program = "cmd" commandline = '/c type "p4change.txt" | p4.exe submit -i' verbose = 'true'/>
|
|
<delete file = "p4change.txt" />
|
|
</when>
|
|
<otherwise>
|
|
<echo message = "cov file was unchanged, won't submit." />
|
|
</otherwise>
|
|
</choose>
|
|
|
|
<delete file = "p4.out" />
|
|
|
|
</if>
|
|
</if>
|
|
</target>
|
|
|
|
<!-- ************************************************************************************************ -->
|
|
<!-- * copy resulting files in output directory * -->
|
|
<!-- ************************************************************************************************ -->
|
|
<target name = "CopyFilesToOutputImpl">
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform != 'durango' and platform != 'ps3' and platform != 'linux' and platform != 'android'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}${Target.ideversion}/exe/">
|
|
<include name="${Target.name}_${platform}${platformsuffix}_tests${artifactsuffix}.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform == 'ps3'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}${Target.ideversion}/exe/">
|
|
<include name="${Target.name}_${platform}${platformsuffix}_tests${artifactsuffix}.*" />
|
|
<include name="TEST_*.elf" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform == 'linux'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}/exe/">
|
|
<include name="${Target.name}_${platform}_tests${artifactsuffix}" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform == 'android'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}${Target.ideversion}/bin/">
|
|
<include name="${Target.name}_${platform}_tests${artifactsuffix}.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform == 'mac'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}/exe/">
|
|
<include name="${Target.name}_${platform}_tests${artifactsuffix}" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform == 'ios'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}/exe/">
|
|
<include name="${Target.name}_${platform}_tests${artifactsuffix}.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- Needed until Durango is like other consoles... -->
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true" if = "${platform == 'durango'}">
|
|
<fileset basedir="${Main.BaseLocation}/${_copyto}/${Target.name}/projects/${platform}/${Target.ide}${Target.ideversion}/exe">
|
|
<include name="**/*" />
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name = "CopyFilesToOutput">
|
|
<property name = "_copyto" value = "" />
|
|
<depends on = "CopyFilesToOutputImpl" />
|
|
|
|
<if test = "${string::contains(property::get-value('Target.name'), 'eal')}" >
|
|
<property name = "_copyto" value = "eal/implementations/" />
|
|
<depends on = "CopyFilesToOutputImpl" />
|
|
</if>
|
|
|
|
<!-- copy dll to output, if any -->
|
|
<if test = "${string::contains(property::get-value('Target.config'), 'DLL')}" >
|
|
<echo message = "Copying DLLs..." />
|
|
<copy todir="${Main.BaseLocation}/output/" overwrite = "true" verbose = "true">
|
|
<fileset basedir="${Main.BaseLocation}/lib/${platform}/${Target.ide}${Target.ideversion}/">
|
|
<include name="*_${platform}${platformsuffix}${artifactsuffix}.dll" />
|
|
</fileset>
|
|
</copy>
|
|
</if>
|
|
</target>
|
|
|
|
<!-- ************************************************************************************************ -->
|
|
<!-- * Generate files (projects, blobs, math) * -->
|
|
<!-- ************************************************************************************************ -->
|
|
<target name = "GenerateFiles">
|
|
<echo message = "Generating blobs and projects..." />
|
|
<exec program = "${PYTHON}" workingdir = "generation" commandline = "-B generate_all.py --platform ${platform}"/>
|
|
</target>
|
|
|
|
<!-- ************************************************************************************************** -->
|
|
<!-- * gear_studio_stats_test: entry point of everything. Will do some cleanup before doing anything * -->
|
|
<!-- ************************************************************************************************** -->
|
|
|
|
<target name = "gear_studio_stats_test">
|
|
<exec
|
|
program = "${PYTHON}"
|
|
workingdir = "."
|
|
commandline = "-B dump_stats.py --gearStudioPath=${gearstudiobasedir} --outputPath=${Main.BaseLocation}/output/"
|
|
verbose = "true"
|
|
failonerror = "true"/>
|
|
</target>
|
|
|
|
</project>
|