This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Repository navigation
Use instrumented tests for skip android test --apk - #201
Merged
Merged
Conversation
skip android test --apk
2 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves on #199 by using instrumented tests to run the test cases. This simplifies things because instrumented tests can stream their test output directly back to the
adb shell am instrumentcommand that launches it, as opposed to having to pass everything throughlogcatwithadb shell am startand having the test client need to watchadb logcatfor the expected messages. It also means that we can remove the extra C module from the generatedPackage.swift, since we no longer need to implement a NativeActivity.The down side is that we now need a Java shim class, since it isn't possible to implement
android.app.Instrumentationpurely in native code, and we need to use some gnarly JNI to communicate between the Java and the Swift. Plus, we need tojavacandd8the class and manually include it in the.apk. This is regrettable but unavoidable, and the benefits of using proper instrumented testing rather than performing testing through an app is worth the extra complexity, IMO.