GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing skip.dev — SkipUnit SkipUnitBase Skip gradle plugin module and unit testing for Skip apps, adapting Swift XCUnit to transpiled Kotlin JUnit test cases. SkipUnit vends the DependenciesSection titled “Dependencies”SkipUnit depends on the skip ↗ transpiler plugin and has no additional library dependencies. It is part of the Skip Core Frameworks and is not intended to be imported directly.
The module is transparently adopted through the translation of Parity TestingSection titled “Parity Testing”Parity testing is a central aspect of Skip development. It ensures that your Swift and Kotlin behave exactly the same. You do not need to import any Skip-specific libraries or APIs in order to perform parity testing.
The standard modules of Your tests do need to run against both the macOS and iOS platforms, because the Skip tests are only executed when running on the macOS destination. See Running Tests from Xcode. Testing ModesSection titled “Testing Modes”When writing Swift code that doesn’t need access to device-specific services or other iOS-specific capabilities, the fastest development path is to build and run against macOS. Most common APIs behave the same between macOS and iOS, and running tests locally against the macOS version of an app enables quick unit testing cycles, both when developing with Xcode interactively, as well as running as part of a continuous integration (CI) process by running Similarly, when running transpiled Kotlin/Gradle tests, the fastest development mode is to run the JUnit tests locally without launching an Android emulator or connecting to a device. While the Java and Kotlin APIs that underly Keep in mind that Robolectric is not Android. The local Robolectric testing environment is similar, but not identical, to an actual Android emulator or device. Some Android APIs are missing from Robolectric, and it is possible that the compiled Java bytecode run locally differs from the Dalvik/ART byte code that is run in a true Android environment. If this becomes a problem, follow the instructions below to run the tests on an Android device or emulator instead. These six modes of testing can be summarized by the following table:
By default, Skip uses the simulated Robolectric Android environment to run your transpiled tests. To run them against an Android device or emulator instead, set the device or emulator ID in the Writing TestsSection titled “Writing Tests”Skip Lite supports both XCTest and a subset of Swift Testing for writing transpiled tests. XCTestSection titled “XCTest”A standard Skip test using XCTest: Swift TestingSection titled “Swift Testing”You can also write tests using Swift Testing’s Freestanding The following Swift Testing features are supported:
Not all Swift Testing features are currently transpiled. Parameterized tests, traits, and tags are not supported. Note: The Skip transpiler currently does not have access to the internal API of the module being tested. If you take advantage of Swift’s Running TestsSection titled “Running Tests”The transpiled unit tests are intended to be run as part of the standard Xcode and Swift Package Manager testing process. The tests are driven by a test harness file called If you need to customize the test harness (for example, to specify a device target or adjust the Gradle task), you can add your own Running Tests from XcodeSection titled “Running Tests from Xcode”The transpiled test cases will automatically run whenever testing against the macOS run destination. As such, you need to ensure that your Swift code compiles and runs the same on macOS and iOS. This is a pre-requisite for Skip’s parity testing, which runs the XCUnit test cases on macOS against the transpiled Kotlin tests in the Android testing environment. While many of the Foundation and SwiftUI APIs are identical on macOS and iOS, you may occasionally have to work around minor differences. The transpiled unit tests are run by forking the Running Tests from the CLI/CISection titled “Running Tests from the CLI/CI”The Note that running test cases will also initiate a Gradle build, which has the side-effect of Gradle downloading all the library dependencies for the modules. When tests depend on frameworks like This may lead to a slow initial run of the tests and a perception that the tests may be hanging or excessively slow. Subsequent runs will use the cached dependencies, and will thus run much more quickly. Running Tests from Android StudioSection titled “Running Tests from Android Studio”Once your module and tests have been transpiled, you can run the JUnit tests directly from Android Studio. To open the tests for a module created with Running in Android Studio allows you to bypass the iOS tests and to run - and to debug - individual Android tests. This can be helpful when tracking down Android-specific failures. Test FailuresSection titled “Test Failures”Test failures differ in the XCTest and JUnit worlds. When an Implementation NotesSection titled “Implementation Notes”The adaptation from Swift XCUnit to Kotlin JUnit test cases is quite simple. For example: Transpiled Kotlin Test CaseSection titled “Transpiled Kotlin Test Case”While you may never need to interact with it directly, the transpiled Kotlin for the example test case above looks like this: ReleasesSection titled “Releases”The 10 most recent releases of skiptools/skip-unit ↗:
Full history: github.com/skiptools/skip-unit/releases ↗ — .atom feed ↗ | ||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |