0
TestDroidでAndroid Instrumentationテストを実行すると、JUnit XMLが出力されます。たとえば、testdroidのjunit xmlにメタデータを追加
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<testsuites>
<testsuite errors="0" failures="1" hostname="Acer Iconia Tab A1-810 - YSF6Y9HE6SQCOJPV" name="ExampleInstrumentedTest" package="com.myco.androidtest" tests="2" time="0.0000" timestamp="Fri Sep 29 21:29:49 CEST 2017">
<testcase classname="com.myco.androidtest.ExampleInstrumentedTest" name="someTest" time="0.0000"/>
<testcase classname="com.myco.androidtest.ExampleInstrumentedTest" name="someOtherTest" time="0.0000">
<failure message="" type="">java.lang.AssertionError
at org.junit.Assert.fail(Assert.java:86)
...
</failure>
</testcase>
</testsuite>
<properties>
...
<property name="ro.product.manufacturer" value="Acer"/>
<property name="ro.serialno" value="32206769320"/>
<property name="ro.product.name" value="a1-810_ww_gen1"/>
<property name="ro.build.version.release" value="4.2.2"/>
<property name="ro.build.version.sdk" value="17"/>
<property name="ro.build.fingerprint" value="acer/a1-810_ww_gen1/mango:4.2.2/JDQ39/1381313631:user/release-keys"/>
<property name="ro.product.cpu.abi" value="armeabi-v7a"/>
<property name="ro.product.model" value="A1-810"/>
</properties>
</testsuites>
テストに関するメタデータに加えて、JavaシステムプロパティをXMLにダンプしているようですが、これは非常に便利です。
JUnit XMLのメタデータ/プロパティに追加したいと思います。どのようにそれを行うことができるかに関する任意のアイデア?