'Run scala tests on Android

(Sequel to this.) There's a Java library to which I have added patches for Android support. I would like to automate testing of the code, but in order to check if it runs properly on Android, I need to test it on Android. (Current progress here.) I've moved the main code into a "java" module, and created an "android" module to run the Android instrumented tests (tests that run on a device or emulator). Now, I'd really prefer to run all the normal tests again but on Android (so nobody has to rewrite all the tests and keep them up-to-date), by e.g. adding a line to the gradle file or creating a symbolic link, but so far I haven't found a gradle command to do it, and a symbolic link did nothing that I could see. Part of the problem, I think, is that the tests are in Scala. Is there a way to run Scala tests as instrumented tests on Android? (Or another way of equivalently solving the problem without a ton of recurring work?) The easiest probably-doable way that's occurred to me is to add a test in Android that manually calls the other tests (e.g. com.whatever.Tests.testThatThing();), but that requires maintenance as tests are created/removed, and I'm not sure there won't be problems with like, tests not being exported for external use or something.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source