Tests: the native suite in seconds, every test on its own, all cores
CI / test (push) Canceled after 0s
Deploy to the handset / build-and-deploy (push) Successful in 3m11s

- scripts/test-native.py (just t WORD): builds once, runs each test in its own
  process in parallel, longest first, with a timeout; CI and just test use it.
- Tests no longer search this machine's apps and icon themes.
- Compiled wasm modules are cached between test processes (CHANDRA_WASM_CACHE).
- draw_circle fills its middle with spans (same pixels); encode_png writes into
  one buffer, with a CRC table.
- The ffprobe helper always waited out its 20 s: its done file was empty.
- The fake polkit helper no longer depends on which shell sh is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-11-29 23:45:29 -08:00
1 parent d1d1bb398c
commit 5ca7242615
12 files changed
+397 -81

No files matched your search

+11 -2
View File
@@ -2,6 +2,12 @@
/// .desktop file (`resolve_app_id`), whose Icon= key is looked up in the freedesktop icon themes
/// (a simplified icon theme spec lookup), and the file is loaded for `Image` draw ops.
///| Under the tests: only what XDG_DATA_HOME / XDG_DATA_DIRS name, not this machine's own apps and
/// icons, which are slow to search and differ between machines.
fn test_run() -> Bool {
@sys.getenv("CHANDRA_TEST_CONFIG") == "1"
}
///| Base directories icon themes live in, highest priority first.
fn icon_base_dirs() -> Array[String] {
let home = @sys.getenv("HOME")
@@ -18,7 +24,9 @@ fn icon_base_dirs() -> Array[String] {
}
}
dirs.push(home + "/.local/share/flatpak/exports/share/icons")
dirs.push("/var/lib/flatpak/exports/share/icons")
if !test_run() {
dirs.push("/var/lib/flatpak/exports/share/icons")
}
dirs
}
@@ -398,7 +406,8 @@ fn IconSearch::from_env() -> IconSearch {
///| The icon file for Icon= value `name`, or None when no theme has it.
fn IconSearch::find(self : IconSearch, name : String, svg_ok : Bool) -> String? {
for path in icon_candidates(name, svg_ok, self.themes, self.bases, ["/usr/share/pixmaps"]) {
let pixmaps = if test_run() { [] } else { ["/usr/share/pixmaps"] }
for path in icon_candidates(name, svg_ok, self.themes, self.bases, pixmaps) {
if @sys.read_file_bytes(path).length() > 0 {
return Some(path)
}