Skip to content

Instantly share code, notes, and snippets.

@jam1401
jam1401 / EspressoXMLInstrumentationTestRunner.java
Created December 31, 2013 21:17
If you are using the new Espresso testing framework on Android with CI then you need a way to generate the test results in an XML format. The existing GoogleInstrumentationTestRunner does not support this. This Gist provides an example TestRunner that provides the test output in XML
package com.google.android.apps.common.testing.testrunner;
import android.app.Instrumentation;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.test.AndroidTestRunner;
import android.test.InstrumentationTestRunner;
import android.test.TestSuiteProvider;
import android.util.Log;
#!/usr/bin/env ruby
def wait
system! "read -p '\033[32m(Press Enter To Continue)\033[33m'"
end
def log(str)
puts "---> \033[32m#{str}\033[0m"
end