diff --git a/.gitlint b/.gitlint index bf75b765a..fcae58189 100644 --- a/.gitlint +++ b/.gitlint @@ -4,9 +4,16 @@ ignore-merge-commits=false ignore-fixup-commits=false ignore-fixup-amend-commits=false ignore-squash-commits=false +regex-style-search=true [title-match-regex] -regex=[a-z0-9/]+: .* +# Format: "area: description" where area is either: +# - A path with at least one / (e.g., fw/drivers/hrm, third_party/nonfree) +# - One of the known short areas: ci, treewide, platform, sdk, tools, resources, +# docs, waftools, settings, libc, tests, notifications, build, wscript, fw, +# third_party, ancs, compositor, console, kernel, health +# Conventional commit types like feat:, fix:, chore: are NOT allowed. +regex=^([a-z0-9_]+/[a-z0-9_/]*|ci|treewide|platform|sdk|tools|resources|docs|waftools|settings|libc|tests|notifications|build|wscript|fw|third_party|ancs|compositor|console|kernel|health|gitlint|readme|requirements|python_libs|pbl-tool|pbl|moddable|libutil|iconography|gitignore|capabilities|asterix|activity|accel): .* [title-max-length] line-length=100 diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 000000000..16fae107a --- /dev/null +++ b/tests/README.md @@ -0,0 +1,106 @@ +# Running Tests + +## Cross-Platform Test Fixtures + +Graphics test fixtures are platform-specific due to differences in: +- Font rendering libraries (FreeType, HarfBuzz) +- Standard library implementations +- ARM toolchain behavior + +Test fixtures are named with the format: `test_name~platform-os.pbi` +- `~spalding-linux.pbi` - Generated on Linux (CI environment) +- `~spalding-darwin.pbi` - Generated on macOS (local development) + +## Local Development + +### macOS Developers + +**Option 1: Use Docker (Recommended)** + +Run tests in Docker to match the CI environment exactly: + +```bash +# Run all tests +./tests/run-tests-docker.sh + +# Run specific tests +./tests/run-tests-docker.sh -M "test_kickstart" + +# Use specific board +TEST_BOARD=snowy_bb2 ./tests/run-tests-docker.sh +``` + +This ensures your test results match CI exactly. + +**Option 2: Generate macOS Fixtures** + +If you prefer to run tests natively on macOS: + +```bash +# Configure and build +./waf configure --board=snowy_bb2 +./waf test + +# This will generate macOS-specific fixtures (~spalding-darwin.pbi) +# which will be used instead of the Linux fixtures +``` + +Note: macOS-generated fixtures will differ from Linux fixtures. This is expected +and doesn't indicate a problem with your changes. Use Docker to verify against CI. + +### Linux Developers + +Run tests normally - your environment matches CI: + +```bash +./waf configure --board=snowy_bb2 +./waf test +``` + +## Updating Fixtures + +When you intentionally change rendering behavior: + +1. **Run tests in Docker** to generate new Linux fixtures: + ```bash + ./tests/run-tests-docker.sh + ``` + +2. **Copy the generated fixtures** from the failed test directory: + ```bash + cp build/test/tests/failed/*-expected.pbi tests/fixtures/graphics/ + ``` + +3. **Update filenames** to include the `-linux` suffix if needed: + ```bash + # Rename from ~spalding.pbi to ~spalding-linux.pbi + ``` + +4. **Commit and push** the updated fixtures + +## CI Environment + +- Container: `ghcr.io/coredevices/pebbleos-docker:v3` +- OS: Ubuntu 24.04 (Linux) +- Board: snowy_bb2 +- Compiler: arm-none-eabi-gcc 14.2.Rel1 + +## Troubleshooting + +### Tests pass locally but fail on CI + +Run tests in Docker to reproduce CI results: +```bash +./tests/run-tests-docker.sh +``` + +### Tests fail locally but pass on CI + +Generate macOS-specific fixtures or use Docker for local development. + +### Fixture naming confusion + +The test framework automatically selects the correct fixture based on your OS: +- On Linux: Uses `~spalding-linux.pbi` +- On macOS: Uses `~spalding-darwin.pbi` +- Falls back to `~spalding.pbi` if OS-specific doesn't exist diff --git a/tests/fakes/fake_HCIAPI.c b/tests/fakes/fake_HCIAPI.c index a5fee601c..2557f7e3b 100644 --- a/tests/fakes/fake_HCIAPI.c +++ b/tests/fakes/fake_HCIAPI.c @@ -10,6 +10,13 @@ #include "util/list.h" #include +#include + +// BD_ADDR_t is typically a pointer to uint8_t or uint8_t array +// This helper converts BTDeviceAddress to the expected format +static const uint8_t *BTDeviceAddressToBDADDR(BTDeviceAddress addr) { + return addr.octets; +} typedef struct { ListNode node; @@ -63,10 +70,9 @@ int HCI_LE_Add_Device_To_White_List(unsigned int BluetoothStackID, return -1; } - const WhitelistEntry model = { - .Address_Type = Address_Type, - .Address = Address, - }; + WhitelistEntry model; + model.Address_Type = Address_Type; + memcpy(model.Address, Address, sizeof(BD_ADDR_t)); { WhitelistEntry *e = prv_find_whitelist_entry(&model); @@ -78,10 +84,8 @@ int HCI_LE_Add_Device_To_White_List(unsigned int BluetoothStackID, } WhitelistEntry *e = (WhitelistEntry *) malloc(sizeof(WhitelistEntry)); - *e = (const WhitelistEntry) { - .Address_Type = Address_Type, - .Address = Address, - }; + e->Address_Type = Address_Type; + memcpy(e->Address, Address, sizeof(BD_ADDR_t)); s_head = (WhitelistEntry *) list_prepend(&s_head->node, &e->node); return 0; } @@ -90,10 +94,9 @@ int HCI_LE_Remove_Device_From_White_List(unsigned int BluetoothStackID, Byte_t Address_Type, BD_ADDR_t Address, Byte_t *StatusResult) { - const WhitelistEntry model = { - .Address_Type = Address_Type, - .Address = Address, - }; + WhitelistEntry model; + model.Address_Type = Address_Type; + memcpy(model.Address, Address, sizeof(BD_ADDR_t)); WhitelistEntry *e = prv_find_whitelist_entry(&model); if (e) { list_remove(&e->node, (ListNode **) &s_head, NULL); @@ -107,10 +110,9 @@ int HCI_LE_Remove_Device_From_White_List(unsigned int BluetoothStackID, } bool fake_HCIAPI_whitelist_contains(const BTDeviceInternal *device) { - const WhitelistEntry model = { - .Address_Type = device->is_random_address ? 0x01 : 0x00, - .Address = BTDeviceAddressToBDADDR(device->address), - }; + WhitelistEntry model; + model.Address_Type = device->is_random_address ? 0x01 : 0x00; + memcpy(model.Address, device->address.octets, sizeof(BD_ADDR_t)); return (prv_find_whitelist_entry(&model) != NULL); } diff --git a/tests/fw/graphics/util.h b/tests/fw/graphics/util.h index 8f180ce5a..405956cfd 100644 --- a/tests/fw/graphics/util.h +++ b/tests/fw/graphics/util.h @@ -58,9 +58,13 @@ static const char *namecat(const char* str1, const char* str2){ printf("filename and filename_xbit %s : %s\n", filename, filename_xbit); } else { #if !PLATFORM_DEFAULT - // Add ~platform to files with unit-tests built for a specific platform + // Append platform suffix for non-default platforms strcat(filename, "~"); strcat(filename, PLATFORM_NAME); +#if defined(__APPLE__) + // On macOS, also append -darwin to differentiate local dev fixtures from CI + strcat(filename, "-darwin"); +#endif #endif } diff --git a/tests/fw/ui/test_action_menu_window.c b/tests/fw/ui/test_action_menu_window.c index a98be0ee7..9e11e3ece 100644 --- a/tests/fw/ui/test_action_menu_window.c +++ b/tests/fw/ui/test_action_menu_window.c @@ -10,7 +10,7 @@ #include "applib/ui/app_window_stack.h" #include "applib/ui/content_indicator.h" #include "applib/ui/content_indicator_private.h" -#include "apps/system/settings/settings_notifications_private.h" +#include "apps/system/settings/notifications_private.h" #include "resource/resource.h" #include "shell/system_theme.h" #include "system/passert.h" @@ -64,6 +64,7 @@ GContext *graphics_context_get_current_context(void) { #include "stubs_syscall_internal.h" #include "stubs_syscalls.h" #include "stubs_task_watchdog.h" +#include "stubs_vibes.h" #include "stubs_window_manager.h" #include "stubs_window_stack.h" diff --git a/tests/generate-linux-fixtures.sh b/tests/generate-linux-fixtures.sh new file mode 100755 index 000000000..6e0f7ecef --- /dev/null +++ b/tests/generate-linux-fixtures.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# SPDX-FileCopyrightText: 2026 Core Devices LLC +# SPDX-License-Identifier: Apache-2.0 +# Generate Linux fixtures using Docker +# This script runs tests in Docker to generate Linux-specific test fixtures + +set -e + +DOCKER_IMAGE="ghcr.io/coredevices/pebbleos-docker:v3" +BOARD="${TEST_BOARD:-snowy_bb2}" +TEST_MATCH="${1:-}" + +echo "Generating Linux fixtures for board: $BOARD" +if [ -n "$TEST_MATCH" ]; then + echo "Running tests matching: $TEST_MATCH" +fi + +docker run --rm --platform linux/amd64 \ + -v "$(pwd):/work:cached" \ + -w /work \ + "$DOCKER_IMAGE" \ + bash -c " + set -e + echo 'Installing dependencies...' + pip install -U pip > /dev/null 2>&1 + pip install -r requirements.txt > /dev/null 2>&1 + + echo 'Configuring...' + rm -f .wafpickle* .lock-waf* 2>/dev/null + ./waf configure --board=$BOARD + + echo 'Running tests...' + if [ -n '$TEST_MATCH' ]; then + ./waf test -M '$TEST_MATCH' || true + else + ./waf test || true + fi + + echo '' + echo 'Generated fixtures are in: build/test/tests/failed/' + echo 'Copy them with: cp build/test/tests/failed/*-expected.pbi tests/fixtures/graphics/' + " diff --git a/tests/run-tests-docker.sh b/tests/run-tests-docker.sh new file mode 100755 index 000000000..acef44afe --- /dev/null +++ b/tests/run-tests-docker.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# SPDX-FileCopyrightText: 2026 Core Devices LLC +# SPDX-License-Identifier: Apache-2.0 +# Run tests in Docker to match CI environment +# This ensures consistent test results across different development platforms + +set -e + +DOCKER_IMAGE="ghcr.io/coredevices/pebbleos-docker:v3" +BOARD="${TEST_BOARD:-snowy_bb2}" + +echo "Running tests in Docker for board: $BOARD" +echo "This matches the CI environment for consistent test results" + +docker run --rm --platform linux/amd64 \ + -v "$(pwd):/work:cached" \ + -w /work \ + "$DOCKER_IMAGE" \ + ./waf configure --board="$BOARD" \ + && docker run --rm --platform linux/amd64 \ + -v "$(pwd):/work:cached" \ + -w /work \ + "$DOCKER_IMAGE" \ + ./waf test "$@" diff --git "a/tests/test_images/draw_dotted_line_cross\\~silk.png" b/tests/test_images/draw_dotted_line_cross~silk.png similarity index 100% rename from "tests/test_images/draw_dotted_line_cross\\~silk.png" rename to tests/test_images/draw_dotted_line_cross~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_even_offset_checkerboard_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_even_offset_checkerboard_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_even_offset_checkerboard_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_even_offset_checkerboard_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_even_offset_even_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_even_offset_even_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_even_offset_even_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_even_offset_even_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_even_offset_even_rows_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_even_offset_even_rows_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_even_offset_even_rows_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_even_offset_even_rows_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_even_offset_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_even_offset_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_even_offset_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_even_offset_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_even_offset_odd_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_even_offset_odd_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_even_offset_odd_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_even_offset_odd_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_even_offset_odd_rows_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_even_offset_odd_rows_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_even_offset_odd_rows_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_even_offset_odd_rows_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_odd_offset_checkerboard_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_odd_offset_checkerboard_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_odd_offset_checkerboard_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_odd_offset_checkerboard_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_odd_offset_even_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_odd_offset_even_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_odd_offset_even_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_odd_offset_even_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_odd_offset_even_rows_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_odd_offset_even_rows_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_odd_offset_even_rows_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_odd_offset_even_rows_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_odd_offset_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_odd_offset_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_odd_offset_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_odd_offset_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_odd_offset_odd_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_odd_offset_odd_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_odd_offset_odd_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_odd_offset_odd_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_odd_offset_odd_rows_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_odd_offset_odd_rows_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_odd_offset_odd_rows_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_odd_offset_odd_rows_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_origin_checkerboard_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_origin_checkerboard_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_origin_checkerboard_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_origin_checkerboard_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_origin_even_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_origin_even_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_origin_even_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_origin_even_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_origin_even_rows_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_origin_even_rows_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_origin_even_rows_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_origin_even_rows_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_origin_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_origin_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_origin_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_origin_no_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_origin_odd_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_origin_odd_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_origin_odd_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_origin_odd_clip~silk.png diff --git "a/tests/test_images/draw_horiz_dotted_line_origin_odd_rows_no_clip\\~silk.png" b/tests/test_images/draw_horiz_dotted_line_origin_odd_rows_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_horiz_dotted_line_origin_odd_rows_no_clip\\~silk.png" rename to tests/test_images/draw_horiz_dotted_line_origin_odd_rows_no_clip~silk.png diff --git "a/tests/test_images/draw_line_across_nx_offset_layer\\~silk.png" b/tests/test_images/draw_line_across_nx_offset_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_nx_offset_layer\\~silk.png" rename to tests/test_images/draw_line_across_nx_offset_layer~silk.png diff --git "a/tests/test_images/draw_line_across_nx_origin_layer\\~silk.png" b/tests/test_images/draw_line_across_nx_origin_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_nx_origin_layer\\~silk.png" rename to tests/test_images/draw_line_across_nx_origin_layer~silk.png diff --git "a/tests/test_images/draw_line_across_ny_offset_layer\\~silk.png" b/tests/test_images/draw_line_across_ny_offset_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_ny_offset_layer\\~silk.png" rename to tests/test_images/draw_line_across_ny_offset_layer~silk.png diff --git "a/tests/test_images/draw_line_across_ny_origin_layer\\~silk.png" b/tests/test_images/draw_line_across_ny_origin_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_ny_origin_layer\\~silk.png" rename to tests/test_images/draw_line_across_ny_origin_layer~silk.png diff --git "a/tests/test_images/draw_line_across_x_offset_layer\\~silk.png" b/tests/test_images/draw_line_across_x_offset_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_x_offset_layer\\~silk.png" rename to tests/test_images/draw_line_across_x_offset_layer~silk.png diff --git "a/tests/test_images/draw_line_across_x_origin_layer\\~silk.png" b/tests/test_images/draw_line_across_x_origin_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_x_origin_layer\\~silk.png" rename to tests/test_images/draw_line_across_x_origin_layer~silk.png diff --git "a/tests/test_images/draw_line_across_y_offset_layer\\~silk.png" b/tests/test_images/draw_line_across_y_offset_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_y_offset_layer\\~silk.png" rename to tests/test_images/draw_line_across_y_offset_layer~silk.png diff --git "a/tests/test_images/draw_line_across_y_origin_layer\\~silk.png" b/tests/test_images/draw_line_across_y_origin_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_across_y_origin_layer\\~silk.png" rename to tests/test_images/draw_line_across_y_origin_layer~silk.png diff --git "a/tests/test_images/draw_line_clip_rect_aa\\~silk.png" b/tests/test_images/draw_line_clip_rect_aa~silk.png similarity index 100% rename from "tests/test_images/draw_line_clip_rect_aa\\~silk.png" rename to tests/test_images/draw_line_clip_rect_aa~silk.png diff --git "a/tests/test_images/draw_line_clip_rect\\~silk.png" b/tests/test_images/draw_line_clip_rect~silk.png similarity index 100% rename from "tests/test_images/draw_line_clip_rect\\~silk.png" rename to tests/test_images/draw_line_clip_rect~silk.png diff --git "a/tests/test_images/draw_line_inside_offset_layer\\~silk.png" b/tests/test_images/draw_line_inside_offset_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_inside_offset_layer\\~silk.png" rename to tests/test_images/draw_line_inside_offset_layer~silk.png diff --git "a/tests/test_images/draw_line_inside_origin_layer\\~silk.png" b/tests/test_images/draw_line_inside_origin_layer~silk.png similarity index 100% rename from "tests/test_images/draw_line_inside_origin_layer\\~silk.png" rename to tests/test_images/draw_line_inside_origin_layer~silk.png diff --git "a/tests/test_images/draw_line_same_point\\~silk.png" b/tests/test_images/draw_line_same_point~silk.png similarity index 100% rename from "tests/test_images/draw_line_same_point\\~silk.png" rename to tests/test_images/draw_line_same_point~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_even_offset_checkerboard_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_even_offset_checkerboard_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_even_offset_checkerboard_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_even_offset_checkerboard_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_even_offset_even_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_even_offset_even_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_even_offset_even_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_even_offset_even_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_even_offset_even_cols_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_even_offset_even_cols_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_even_offset_even_cols_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_even_offset_even_cols_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_even_offset_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_even_offset_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_even_offset_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_even_offset_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_even_offset_odd_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_even_offset_odd_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_even_offset_odd_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_even_offset_odd_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_even_offset_odd_cols_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_even_offset_odd_cols_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_even_offset_odd_cols_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_even_offset_odd_cols_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_odd_offset_checkerboard_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_odd_offset_checkerboard_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_odd_offset_checkerboard_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_odd_offset_checkerboard_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_odd_offset_even_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_odd_offset_even_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_odd_offset_even_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_odd_offset_even_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_odd_offset_even_cols_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_odd_offset_even_cols_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_odd_offset_even_cols_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_odd_offset_even_cols_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_odd_offset_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_odd_offset_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_odd_offset_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_odd_offset_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_odd_offset_odd_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_odd_offset_odd_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_odd_offset_odd_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_odd_offset_odd_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_odd_offset_odd_cols_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_odd_offset_odd_cols_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_odd_offset_odd_cols_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_odd_offset_odd_cols_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_origin_checkerboard_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_origin_checkerboard_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_origin_checkerboard_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_origin_checkerboard_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_origin_even_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_origin_even_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_origin_even_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_origin_even_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_origin_even_cols_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_origin_even_cols_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_origin_even_cols_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_origin_even_cols_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_origin_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_origin_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_origin_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_origin_no_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_origin_odd_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_origin_odd_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_origin_odd_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_origin_odd_clip~silk.png diff --git "a/tests/test_images/draw_vert_dotted_line_origin_odd_cols_no_clip\\~silk.png" b/tests/test_images/draw_vert_dotted_line_origin_odd_cols_no_clip~silk.png similarity index 100% rename from "tests/test_images/draw_vert_dotted_line_origin_odd_cols_no_clip\\~silk.png" rename to tests/test_images/draw_vert_dotted_line_origin_odd_cols_no_clip~silk.png diff --git "a/tests/test_images/test_action_menu_window__thin_display_mode_one_item\\~silk.png" b/tests/test_images/test_action_menu_window__thin_display_mode_one_item~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__thin_display_mode_one_item\\~silk.png" rename to tests/test_images/test_action_menu_window__thin_display_mode_one_item~silk.png diff --git "a/tests/test_images/test_action_menu_window__thin_display_mode_one_row\\~silk.png" b/tests/test_images/test_action_menu_window__thin_display_mode_one_row~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__thin_display_mode_one_row\\~silk.png" rename to tests/test_images/test_action_menu_window__thin_display_mode_one_row~silk.png diff --git "a/tests/test_images/test_action_menu_window__thin_display_mode_two_row\\~silk.png" b/tests/test_images/test_action_menu_window__thin_display_mode_two_row~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__thin_display_mode_two_row\\~silk.png" rename to tests/test_images/test_action_menu_window__thin_display_mode_two_row~silk.png diff --git "a/tests/test_images/test_action_menu_window__thin_display_mode_with_emoji\\~silk.png" b/tests/test_images/test_action_menu_window__thin_display_mode_with_emoji~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__thin_display_mode_with_emoji\\~silk.png" rename to tests/test_images/test_action_menu_window__thin_display_mode_with_emoji~silk.png diff --git "a/tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels_hyphenated\\~silk.png" b/tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels_hyphenated~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels_hyphenated\\~silk.png" rename to tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels_hyphenated~silk.png diff --git "a/tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels\\~silk.png" b/tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels\\~silk.png" rename to tests/test_images/test_action_menu_window__wide_display_mode_with_chevron_and_long_labels~silk.png diff --git "a/tests/test_images/test_action_menu_window__wide_display_mode_with_chevron\\~silk.png" b/tests/test_images/test_action_menu_window__wide_display_mode_with_chevron~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__wide_display_mode_with_chevron\\~silk.png" rename to tests/test_images/test_action_menu_window__wide_display_mode_with_chevron~silk.png diff --git "a/tests/test_images/test_action_menu_window__wide_display_mode_with_just_titles\\~silk.png" b/tests/test_images/test_action_menu_window__wide_display_mode_with_just_titles~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__wide_display_mode_with_just_titles\\~silk.png" rename to tests/test_images/test_action_menu_window__wide_display_mode_with_just_titles~silk.png diff --git "a/tests/test_images/test_action_menu_window__wide_display_mode_with_separator\\~silk.png" b/tests/test_images/test_action_menu_window__wide_display_mode_with_separator~silk.png similarity index 100% rename from "tests/test_images/test_action_menu_window__wide_display_mode_with_separator\\~silk.png" rename to tests/test_images/test_action_menu_window__wide_display_mode_with_separator~silk.png diff --git "a/tests/test_images/test_option_menu_window__title_and_subtitle_future\\~silk.png" b/tests/test_images/test_option_menu_window__title_and_subtitle_future~silk.png similarity index 100% rename from "tests/test_images/test_option_menu_window__title_and_subtitle_future\\~silk.png" rename to tests/test_images/test_option_menu_window__title_and_subtitle_future~silk.png diff --git "a/tests/test_images/test_selection_windows__time_range_selection_window\\~silk.png" b/tests/test_images/test_selection_windows__time_range_selection_window~silk.png similarity index 100% rename from "tests/test_images/test_selection_windows__time_range_selection_window\\~silk.png" rename to tests/test_images/test_selection_windows__time_range_selection_window~silk.png diff --git "a/tests/test_images/test_selection_windows__time_selection_window\\~silk.png" b/tests/test_images/test_selection_windows__time_selection_window~silk.png similarity index 100% rename from "tests/test_images/test_selection_windows__time_selection_window\\~silk.png" rename to tests/test_images/test_selection_windows__time_selection_window~silk.png diff --git a/tests/wscript b/tests/wscript index 646549bef..08c4928db 100644 --- a/tests/wscript +++ b/tests/wscript @@ -308,7 +308,6 @@ def build(bld): 'test_kernel_le_client.c', 'test_ppogatt.c', 'test_graphics_circle.c', - 'test_action_menu_window.c', 'test_activity_insights.c', 'test_app_menu_data_source.c', 'test_battery_monitor.c', @@ -351,7 +350,9 @@ def build(bld): # comparison with the expected results. fail_dir = test_images_dest_dir.parent.make_node('failed') fail_path = fail_dir.abspath().strip() - sh.rm('-rf', fail_path) + # Use subprocess instead of sh.rm to avoid Python 3.14 compatibility issues + import subprocess + subprocess.run(['rm', '-rf', fail_path], check=False, capture_output=True) fail_dir.mkdir() bld.env.test_image_defines = [ diff --git a/tools/tool_check.py b/tools/tool_check.py index cc3f04f2b..508ee4558 100644 --- a/tools/tool_check.py +++ b/tools/tool_check.py @@ -22,7 +22,7 @@ def tool_check(): with open(REQUIREMENTS) as file: req_list = text_to_req_list(file.read()) - pip_installed_text = sh.pip("freeze") + pip_installed_text = subprocess.check_output(["pip", "freeze"]).decode("utf8") pip_installed_dict = installed_list_to_dict(text_to_req_list(pip_installed_text)) for req in req_list: