I've read every question related to this and nothing is working for me.
- Android studio version: 2.3.3
- compileSdkVersion 25
- buildToolsVersion '26.0.1'
- Gradle build tools version: 2.3.3
I'm trying to do something very simple. When I run a test, I want to see the output of the test. Here's some sample code:
// MyClassTest
@Test
public void myMethodTest() throws Exception {
System.out.println("Hello from myMethodTest!");
int res = Whitebox.invokeMethod(MyClass.class, "myMethod", arg1, arg2);
assertThat(res, is(1));
}
// MyClass
private int myMethod(int arg1, int arg2) {
System.out.println("Hello from myMethod!");
return 0;
}
The whitebox stuff is probably not important here but I included it just in case. When I run this all it tells me is that the assertion failed. I also get the "Hello from myMethodTest"
output, but I can't see the "Hello from myMethod"
output. This makes it extremely hard to figure out where my method is going wrong. None of the Timber stuff I'm logging appears either.
I've tried running the tests via both the GUI and the console with gradle
and gradlew
, with all the various options (--info
, --stacktrace
, etc.). I've also tried all the stuff here, here, and here. Surely this must be possible, thanks.