liblinphone_tester: do not retrieve xml result file if crash occured
This commit is contained in:
parent
e66022b1dc
commit
375eec05ac
1 changed files with 20 additions and 17 deletions
|
@ -12,21 +12,20 @@
|
|||
</exec>
|
||||
</target>
|
||||
<target name="test">
|
||||
<property name="output.file" value="./tests.output" />
|
||||
<property name="output.file" value="./tests.output" />
|
||||
<tstamp>
|
||||
<format property="archive.name"
|
||||
pattern="'liblinphonetester_'yyyyMMdd_HHmmss" />
|
||||
</tstamp>
|
||||
<echo>Adb log files are put in ${archive.name}.zip</echo>
|
||||
<format property="archive.name" pattern="'liblinphonetester_'yyyyMMdd_HHmmss" />
|
||||
</tstamp>
|
||||
<echo>Adb log files are put in ${archive.name}.zip</echo>
|
||||
|
||||
<exec executable="adb" >
|
||||
<exec executable="adb" >
|
||||
<arg value="logcat" />
|
||||
<arg value="-c" />
|
||||
</exec>
|
||||
<exec executable="./adb-log-start.sh" >
|
||||
<exec executable="./adb-log-start.sh" >
|
||||
<arg value=" ${archive.name}" />
|
||||
</exec>
|
||||
<exec executable="bash">
|
||||
<exec executable="bash">
|
||||
<arg value="-c"/>
|
||||
<!-- use 'tee' command to write in file AND on stdout.
|
||||
First is used below to check if tests failed or not while second
|
||||
|
@ -37,25 +36,29 @@
|
|||
<arg value="-c" />
|
||||
<arg value="kill `cat adb.pid`" />
|
||||
</exec>
|
||||
<exec executable="bash">
|
||||
<condition property="has.crashed" >
|
||||
<or>
|
||||
<resourcecontains resource="${output.file}" substring="Process crashed" />
|
||||
<resourcecontains resource="${output.file}" substring="Native crash" />
|
||||
</or>
|
||||
</condition>
|
||||
<exec executable="bash" unless:set="has.crashed">
|
||||
<arg value="-c"/>
|
||||
<arg value="adb shell run-as org.linphone.tester cat /data/data/org.linphone.tester/files/junit-report.xml > liblinphone-junit-report.xml"/>
|
||||
</exec>
|
||||
|
||||
<zip destfile="${archive.name}.zip">
|
||||
<fileset dir="." includes="${archive.name}"/>
|
||||
</zip>
|
||||
|
||||
<antcall target="check-for-crash"/>
|
||||
|
||||
<fail message="Tests failed">
|
||||
<condition>
|
||||
<resourcecontains resource="${output.file}" substring="FAILURES" />
|
||||
<resourcecontains resource="${output.file}" substring="FAILURES" />
|
||||
</condition>
|
||||
</fail>
|
||||
<condition property="has.crashed" >
|
||||
<or>
|
||||
<resourcecontains resource="${output.file}" substring="Process crashed" />
|
||||
<resourcecontains resource="${output.file}" substring="Native crash" />
|
||||
</or>
|
||||
</condition>
|
||||
<antcall target="check-for-crash"/>
|
||||
|
||||
<delete file="${archive.name}"/>
|
||||
<delete file="${output.file}"/>
|
||||
</target>
|
||||
|
|
Loading…
Reference in a new issue