Repository navigation
Android: run the tests on an x86_64 emulator, in CI and before a release - #823
Merged
Merged
Conversation
…4 emulator tslang/test/android/run_tests.mjs builds the tests for x86_64 Android (API 29) under gc, rc, none and own (--build: tslang, the NDK and the Android libraries; programs stripped) and runs them on a device or emulator through adb (--run: a leg at a time, four programs at a time, each under timeout and a memory limit; exit code, markers and output tails come back). The test list, skips and pass rules are shared with the wasm runner (tslang/test/suites.mjs). test-android.yml builds the programs on Windows with a Windows package (the only one that ships Android's libraries) and runs them on an API 29 x86_64 emulator on Linux (KVM). create-release runs it against the package it has just built (test_android); a pull request that changes the runner runs it against the latest published release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASDAlexander77
added a commit
that referenced
this pull request
Nov 12, 2026
…etplace actions are not allowed) (#825) * Android emulator tests: boot the emulator with the runner's SDK, not a marketplace action The repository allows GitHub's own actions only, so reactivecircus/android-emulator-runner was refused and test-android.yml - and create-release.yml, which calls it - failed at startup (the re-tagged v0.0-pre-alpha125 run, and #823's own run). The job now installs the emulator and an API 29 x86_64 image with the runner's sdkmanager, creates the AVD, boots it headless on KVM, waits for sys.boot_completed and runs the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Android emulator tests: take the newest release, not GitHub's "latest" Every release is a pre-release, which GitHub's "latest" leaves out, so `gh release download` with no tag found none ("release not found") in #825's run. List the newest non-draft release and download its Windows package by tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Android programs now run on an emulator, not just link. This PR runs the tester's tests and the default library's tests, built for x86_64 Android (API 29) under
gc,rc,noneandown, on an x86_64 emulator. It does this in CI and before each release.tslang/test/android/run_tests.mjs--buildcompiles each test (-mtriple=x86_64-linux-android29 --opt) and links it through the NDK.--android-lib=<package>\android\x86_64\lib).llvm-strip. Most of a program's size is debug info from the collector, libc++ and the default library's C++ wrappers: unstripped, the build is 4.6 GB; stripped, 832 MB (320 MB as a tar.gz).manifest.jsontoout/.--runneeds only adb andout/.timeoutandulimit -v. An out-of-memory kill of an adb-shell process can take the emulator down.done./ALL DONE, how much it wrote to stderr, the last lines of its output, and how long it ran.timeoutreturns 124 for a program that died from a signal as well as for a timeout. The runner tells them apart by the run time: a crash is a FAIL, not a TIMEOUT.Shared code: the test list, skips and pass rules move into
tslang/test/suites.mjs, which the wasm runner now uses too, unchanged otherwise.android_skips.txt, each with its reason:00cppvtable_hidden_return.ts: Windows-only by design, as in ctest.fetch.ts: Android's default library has no HTTP.json.tsundernone: about 5 GB never freed.00global_interface_initializer.tsunderown: the same assert fails natively.The last three are the same as in the wasm skips.
CI (
.github/workflows/test-android.yml)tslang.exe, the runner's NDK andandroid/x86_64/lib. It uploadsout/as an artifact.reactivecircus/android-emulator-runner).test_android), andcreate_releasewaits for it.arm64-v8a and armeabi-v7a are still only linked (
test-compile-android-link, #822). An x86_64 emulator runs them only through a binary translator, which isn't reliable enough to test with.Testing
Locally, on an API 29 x86_64 emulator, with NDK r30:
owncannot compile natively either)suites.mjs.🤖 Generated with Claude Code