Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ jobs:

- name: Run tests
run: ./waf test
continue-on-error: true

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
if: (!cancelled())
with:
report_paths: build/test/junit.xml
annotate_only: true

- name: Store failed test images
uses: actions/upload-artifact@v4
if: (!cancelled())
with:
name: failed_diff_images
path: build/test/tests/failed/*-diff.png
4 changes: 4 additions & 0 deletions src/fw/applib/rockyjs/api/rocky_api_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include <stdlib.h>
#include <string.h>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

#define ROCKY_SINGLETON "_rocky"

// [MT] including <math.h> causes the jerry-libm header to get included again :(
Expand Down
2 changes: 1 addition & 1 deletion tests/fakes/fake_animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ uint32_t animation_get_duration(Animation *animation, bool include_delay, bool i
return ((AnimationPrivate *)animation)->duration_ms;
}

static void prv_call_started(AnimationPrivate *animation, uintptr_t UNUSED context) {
static void prv_call_started(AnimationPrivate *animation, uintptr_t PBL_UNUSED context) {
if (animation->implementation && animation->implementation->setup) {
animation->implementation->setup((Animation *)animation);
}
Expand Down
Binary file modified tests/fixtures/resources/system_resources_silk.pbpack
Binary file not shown.
Binary file modified tests/fixtures/resources/system_resources_snowy.pbpack
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/fw/applib/test_app_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,20 @@ size_t sys_app_pp_app_message_inbox_size_maximum(void) {
void sys_app_pp_app_message_analytics_count_drop(void) {
}

void sys_app_pp_app_message_analytics_count_sent(void) {
}

void sys_app_pp_app_message_analytics_count_received(void) {
}

uint32_t sys_app_pp_app_message_get_sent_count(void) {
return 0;
}

uint32_t sys_app_pp_app_message_get_received_count(void) {
return 0;
}

bool sys_get_current_app_is_js_allowed(void) {
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/apps/system_apps/health/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def build(ctx):
" src/fw/applib/graphics/text_render.c" \
" src/fw/applib/graphics/text_resources.c" \
" src/fw/applib/graphics/utf8.c" \
" src/fw/applib/graphics/rtl_support.c" \
" src/fw/applib/graphics/arabic_shaping.c" \
" src/fw/applib/ui/kino/kino_reel.c" \
" src/fw/applib/ui/kino/kino_reel_gbitmap.c" \
" src/fw/applib/ui/kino/kino_reel_gbitmap_sequence.c" \
Expand Down
8 changes: 8 additions & 0 deletions tests/fw/apps/system_apps/launcher/test_launcher_menu_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,14 @@ bool timeline_resources_is_system(TimelineResourceId timeline_id) {
#include "stubs_workout_service.h"
#include "stubs_workout_utils.h"

GColor shell_prefs_get_apps_menu_highlight_color(void) {
return GColorWhite;
}

bool alerts_preferences_get_notification_alternative_design(void) {
return false;
}

// We can't include stubs_process_manager.h because it conflicts with the two helper includes below
void process_manager_send_callback_event_to_process(PebbleTask task, void (*callback)(void *),
void *data) {}
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/apps/system_apps/launcher/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def build(ctx):
" src/fw/applib/graphics/graphics_private_raw.c"
" src/fw/applib/graphics/gtypes.c"
" src/fw/applib/graphics/text_layout.c"
" src/fw/applib/graphics/rtl_support.c"
" src/fw/applib/graphics/arabic_shaping.c"
" src/fw/applib/graphics/text_render.c"
" src/fw/applib/graphics/text_resources.c"
" src/fw/applib/graphics/utf8.c"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "stubs_action_menu.h"
#include "stubs_activity.h"
#include "stubs_alerts_preferences.h"
#include "stubs_analytics.h"
#include "stubs_ancs.h"
#include "stubs_animation_timing.h"
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/apps/system_apps/timeline/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def build(ctx):
"src/fw/applib/graphics/gtypes.c "
"src/fw/applib/graphics/perimeter.c "
"src/fw/applib/graphics/text_layout.c "
"src/fw/applib/graphics/rtl_support.c "
"src/fw/applib/graphics/arabic_shaping.c "
"src/fw/applib/graphics/text_render.c "
"src/fw/applib/graphics/text_resources.c "
"src/fw/applib/graphics/utf8.c "
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/apps/system_apps/weather/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def build(ctx):
" src/fw/applib/graphics/gtypes.c" \
" src/fw/applib/graphics/perimeter.c" \
" src/fw/applib/graphics/text_layout.c" \
" src/fw/applib/graphics/rtl_support.c" \
" src/fw/applib/graphics/arabic_shaping.c" \
" src/fw/applib/graphics/text_render.c" \
" src/fw/applib/graphics/text_resources.c" \
" src/fw/applib/graphics/utf8.c" \
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/apps/system_apps/workout/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def build(ctx):
" src/fw/applib/graphics/gtypes.c" \
" src/fw/applib/graphics/perimeter.c" \
" src/fw/applib/graphics/text_layout.c" \
" src/fw/applib/graphics/rtl_support.c" \
" src/fw/applib/graphics/arabic_shaping.c" \
" src/fw/applib/graphics/text_render.c" \
" src/fw/applib/graphics/text_resources.c" \
" src/fw/applib/graphics/utf8.c" \
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/apps/watch/kickstart/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def build(ctx):
" src/fw/applib/graphics/gtypes.c" \
" src/fw/applib/graphics/perimeter.c" \
" src/fw/applib/graphics/text_layout.c" \
" src/fw/applib/graphics/rtl_support.c" \
" src/fw/applib/graphics/arabic_shaping.c" \
" src/fw/applib/graphics/text_render.c" \
" src/fw/applib/graphics/text_resources.c" \
" src/fw/applib/graphics/utf8.c" \
Expand Down
21 changes: 21 additions & 0 deletions tests/fw/drivers/test_flash_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,27 @@ status_t flash_impl_get_nvram_erase_status(bool *is_subsector,
return S_FALSE;
}

status_t flash_impl_read_security_register(uint32_t addr, uint8_t *val) {
return S_SUCCESS;
}

status_t flash_impl_security_register_is_locked(uint32_t address, bool *locked) {
*locked = false;
return S_SUCCESS;
}

status_t flash_impl_erase_security_register(uint32_t addr) {
return S_SUCCESS;
}

status_t flash_impl_write_security_register(uint32_t addr, uint8_t val) {
return S_SUCCESS;
}

const FlashSecurityRegisters *flash_impl_security_registers_info(void) {
return NULL;
}

void flash_erase_init(void) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/fw/graphics/test_gbitmap_formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void test_gbitmap_formats__create_blank_with_palette(void) {
}

void test_gbitmap_formats__display_framebuffer_bytes(void) {
#ifdef PLATFORM_TINTIN
#if defined(PLATFORM_TINTIN) || defined(PLATFORM_SILK)
const size_t expected = 20 * 168; // 20 * 8 == 144px + 2 bytes padding per scanline
#endif
#ifdef PLATFORM_SNOWY
Expand Down
10 changes: 5 additions & 5 deletions tests/fw/graphics/test_gtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void test_gtypes__grect_crop_asserts_for_large_insets(void) {
}

void test_gtypes__pbl_if_rect_else(void) {
#if defined(PLATFORM_TINTIN)
#if defined(PLATFORM_TINTIN) || defined(PLATFORM_SILK)
cl_assert_equal_i(1, PBL_IF_RECT_ELSE(1,2));
#elif defined(PLATFORM_SNOWY)
cl_assert_equal_i(1, PBL_IF_RECT_ELSE(1,2));
Expand All @@ -129,7 +129,7 @@ void test_gtypes__pbl_if_rect_else(void) {
}

void test_gtypes__pbl_if_round_else(void) {
#if defined(PLATFORM_TINTIN)
#if defined(PLATFORM_TINTIN) || defined(PLATFORM_SILK)
cl_assert_equal_i(2, PBL_IF_ROUND_ELSE(1,2));
#elif defined(PLATFORM_SNOWY)
cl_assert_equal_i(2, PBL_IF_ROUND_ELSE(1,2));
Expand All @@ -141,7 +141,7 @@ void test_gtypes__pbl_if_round_else(void) {
}

void test_gtypes__pbl_if_bw_else(void) {
#if defined(PLATFORM_TINTIN)
#if defined(PLATFORM_TINTIN) || defined(PLATFORM_SILK)
cl_assert_equal_i(1, PBL_IF_BW_ELSE(1,2));
#elif defined(PLATFORM_SNOWY)
cl_assert_equal_i(2, PBL_IF_BW_ELSE(1,2));
Expand All @@ -153,7 +153,7 @@ void test_gtypes__pbl_if_bw_else(void) {
}

void test_gtypes__pbl_if_color_else(void) {
#if defined(PLATFORM_TINTIN)
#if defined(PLATFORM_TINTIN) || defined(PLATFORM_SILK)
cl_assert_equal_i(2, PBL_IF_COLOR_ELSE(1,2));
#elif defined(PLATFORM_SNOWY)
cl_assert_equal_i(1, PBL_IF_COLOR_ELSE(1,2));
Expand All @@ -165,7 +165,7 @@ void test_gtypes__pbl_if_color_else(void) {
}

void test_gtypes__color_fallback(void) {
#if defined(PLATFORM_TINTIN)
#if defined(PLATFORM_TINTIN) || defined(PLATFORM_SILK)
cl_assert_equal_i(2, COLOR_FALLBACK(1,2));
#elif defined(PLATFORM_SNOWY)
cl_assert_equal_i(1, COLOR_FALLBACK(1,2));
Expand Down
2 changes: 2 additions & 0 deletions tests/fw/graphics/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def build(ctx):
" src/fw/applib/graphics/text_render.c" \
" src/fw/applib/graphics/utf8.c" \
" src/fw/applib/graphics/text_layout.c" \
" src/fw/applib/graphics/rtl_support.c" \
" src/fw/applib/graphics/arabic_shaping.c" \
" src/fw/applib/graphics/perimeter.c" \
" src/fw/applib/graphics/text_resources.c" \
" src/fw/flash_region/flash_region.c" \
Expand Down
10 changes: 5 additions & 5 deletions tests/fw/javascript/test_rocky_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@

#ifndef DO_NOT_STUB_LEGACY2

UNUSED bool process_manager_compiled_with_legacy2_sdk(void) {
PBL_UNUSED bool process_manager_compiled_with_legacy2_sdk(void) {
return false;
}

#endif

UNUSED static jerry_value_t prv_js_global_get_value(char *name) {
PBL_UNUSED static jerry_value_t prv_js_global_get_value(char *name) {
JS_VAR global_obj = jerry_get_global_object();
cl_assert_equal_b(jerry_value_is_undefined(global_obj), false);

Expand All @@ -109,21 +109,21 @@ UNUSED static jerry_value_t prv_js_global_get_value(char *name) {
return jerry_acquire_value(val);
}

UNUSED static bool prv_js_global_get_boolean(char *name) {
PBL_UNUSED static bool prv_js_global_get_boolean(char *name) {
JS_VAR val = prv_js_global_get_value(name);
cl_assert(jerry_value_is_boolean(val));
double rv = jerry_get_boolean_value(val);
return rv;
}

UNUSED static double prv_js_global_get_double(char *name) {
PBL_UNUSED static double prv_js_global_get_double(char *name) {
JS_VAR val = prv_js_global_get_value(name);
cl_assert(jerry_value_is_number(val));
double rv = jerry_get_number_value(val);
return rv;
}

UNUSED static void prv_js_global_get_string(char *name, char *buffer, size_t buffer_size) {
PBL_UNUSED static void prv_js_global_get_string(char *name, char *buffer, size_t buffer_size) {
JS_VAR val = prv_js_global_get_value(name);
cl_assert(jerry_value_is_string(val));
ssize_t num_bytes = jerry_string_to_char_buffer(val, (jerry_char_t *)buffer, buffer_size);
Expand Down
4 changes: 4 additions & 0 deletions tests/fw/services/activity/test_activity.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
#include "stubs_task_watchdog.h"
#include "stubs_worker_manager.h"
#include "stubs_workout_service.h"
#include "stubs_ambient_light.h"

void prefs_sync_init(void) {
}

// Fakes
#include "fake_accel_service.h"
Expand Down
4 changes: 4 additions & 0 deletions tests/fw/services/activity/test_activity_insights.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include "stubs_stringlist.h"
#include "stubs_system_task.h"

bool activity_is_initialized(void) {
return true;
}

// Fakes
#include "fake_kernel_services_notifications.h"
#include "fake_pbl_malloc.h"
Expand Down
4 changes: 4 additions & 0 deletions tests/fw/services/analytics/test_analytics_heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include "stubs_pebble_tasks.h"
#include "stubs_rand_ptr.h"

#include "services/common/analytics/analytics_metric.h"
void memfault_metric_set_device_from_pebble_analytics(AnalyticsMetric metric, int64_t val) {
}

void test_analytics_heartbeat__initialize(void) {
analytics_metric_init();
}
Expand Down
4 changes: 4 additions & 0 deletions tests/fw/services/app_message/test_app_session_capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include "services/normal/settings/settings_file.h"
#include "system/status_codes.h"

#include "stubs_logging.h"
#include "stubs_mutex.h"
#include "stubs_passert.h"

static const CommSessionCapability s_live_capabilities = (CommSessionInfiniteLogDumping);

// Fakes & Stubs
Expand Down
1 change: 1 addition & 0 deletions tests/fw/services/blob_db/test_blob_db2_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "stubs_pbl_malloc.h"
#include "stubs_reminders.h"
#include "stubs_regular_timer.h"
#include "stubs_settings_blob_db.h"


CommSession *comm_session_get_system_session(void) {
Expand Down
1 change: 1 addition & 0 deletions tests/fw/services/blob_db/test_blob_db_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "stubs_pbl_malloc.h"
#include "stubs_reminders.h"
#include "stubs_regular_timer.h"
#include "stubs_settings_blob_db.h"

void bt_persistent_storage_set_unfaithful(bool is_unfaithful) {
return;
Expand Down
8 changes: 7 additions & 1 deletion tests/fw/services/blob_db/test_blob_db_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BlobDBToken blob_db_endpoint_send_writeback(BlobDBId db_id,
BlobDBSyncSession *session = blob_db_sync_get_session_for_id(db_id);
cl_assert(session != NULL);
if (s_num_until_timeout != 0 && s_num_writebacks >= s_num_until_timeout) {
fake_regular_timer_trigger(&session->timeout_timer);
// Don't respond - simulates timeout (message lost/no response from phone)
} else {
system_task_add_callback(prv_handle_response_from_phone, session);
}
Expand Down Expand Up @@ -246,6 +246,12 @@ void test_blob_db_sync__timeout_and_retry(void) {
cl_assert(blob_db_sync_db(BlobDBIdTest) == S_SUCCESS);
prv_generate_responses_from_phone();
cl_assert_equal_i(s_num_writebacks, s_num_until_timeout);

// Cancel the timed-out session so we can start a fresh sync
BlobDBSyncSession *session = blob_db_sync_get_session_for_id(BlobDBIdTest);
cl_assert(session != NULL);
blob_db_sync_cancel(session);

s_num_until_timeout = 0;
cl_assert(blob_db_sync_db(BlobDBIdTest) == S_SUCCESS);
prv_generate_responses_from_phone();
Expand Down
7 changes: 7 additions & 0 deletions tests/fw/services/blob_db/test_prefs_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@
#include "stubs_sleep.h"
#include "stubs_system_theme.h"
#include "stubs_task_watchdog.h"
#include "stubs_ambient_light.h"

void prefs_sync_init(void) {
}

void event_put(PebbleEvent *event) {
}

void i18n_enable(bool enable) {
}
Expand Down
4 changes: 4 additions & 0 deletions tests/fw/services/health/test_health.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include "fake_rtc.h"
#include "fake_pbl_std.h"

bool sys_activity_is_initialized(void) {
return true;
}

static HealthServiceState s_health_service;

// -----------------------------------
Expand Down
1 change: 1 addition & 0 deletions tests/fw/services/test_accel_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ int32_t sys_vibe_get_vibe_strength(void) {
return 0;
}
void accel_set_shake_sensitivity_high(bool sensitivity_high) {}
void accel_set_shake_sensitivity_percent(uint8_t percent) {}
QueueHandle_t pebble_task_get_to_queue(PebbleTask task) {
return NULL;
}
Expand Down
Loading
Loading