Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8efa68601 | ||
|
|
e1989a20aa | ||
|
|
0377b9181b | ||
|
|
00fabf1981 | ||
|
|
f992a9180b | ||
|
|
41df5d5dba |
No files matched your search
@@ -746,6 +746,14 @@ jobs:
|
||||
make android-copy-release-apks
|
||||
make android-copy-bundle
|
||||
|
||||
- name: Preserve Android Native Crash Symbols
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-native-symbols
|
||||
path: droid/app/build/intermediates/native_debug_metadata/**/out/**/*.dbg
|
||||
if-no-files-found: error
|
||||
retention-days: 90
|
||||
|
||||
- name: Collect Android Release Files
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
# Changelog
|
||||
## [2.0.8] - 2026-10-02
|
||||
### Fixed
|
||||
- Fixed an Android startup crash after upgrading from older versions, while preserving saved preferences and practice history.
|
||||
- Keep drawing the app when a device cannot allocate the graphics buffers used for screen transitions.
|
||||
|
||||
## [2.0.7] - 2026-10-01
|
||||
### Added
|
||||
- Mini mode provides a compact practice window without changing your saved window or navigation settings.
|
||||
@@ -12,6 +17,8 @@
|
||||
- Refined Settings, Profile, Lists, habit cards, session controls, and mood check-in buttons. Desktop users can zoom with Ctrl and the mouse wheel.
|
||||
|
||||
### Fixed
|
||||
- Music keeps playing when you switch tabs inside the app or leave practice customization.
|
||||
- Restored sound and music playback in the web app.
|
||||
- Appearance dropdown menus stay above the Layout card and other settings, keeping every option visible and selectable.
|
||||
- Practice Customize and How-to actions now open the correct pages, and carousel swipes reliably change practices.
|
||||
- Animated screens keep their controls visible, and navigation transitions finish before accepting the next action.
|
||||
|
||||
@@ -828,6 +828,11 @@ native-screenshot-test: $(TARGET)
|
||||
native-navigation-test: $(TARGET)
|
||||
sh tests/native_navigation_test.sh $(abspath $(TARGET))
|
||||
|
||||
.PHONY: music-navigation-test
|
||||
music-navigation-test: $(TARGET)
|
||||
@python3 tests/music_navigation_test.py '$(CC)' '$(NATIVE_COMPILE_FLAGS)' \
|
||||
'$(KRYON_LIBRARY_BUILD_DIR)/libkryon.a $(KRYON_NATIVE_BACKEND_LIBS) $(LIBOQS_A) $(KRYON_NATIVE_BACKEND_LDLIBS) $(RUNTIME_ASSET_LDLIBS) $(NATIVE_SYSTEM_LDLIBS) $(LDFLAGS)'
|
||||
|
||||
.PHONY: native-zoom-test
|
||||
native-zoom-test: $(TARGET)
|
||||
sh tests/native_zoom_test.sh $(abspath $(TARGET))
|
||||
@@ -2328,7 +2333,7 @@ $(WEB_JS_TARGET): | zi-check
|
||||
-sFORCE_FILESYSTEM=1 -sFETCH=1 -sUSE_ZLIB=1 -lidbfs.js \
|
||||
-sALLOW_MEMORY_GROWTH=1 -sINITIAL_MEMORY=268435456 -sSTACK_SIZE=33554432 \
|
||||
-sEXPORTED_RUNTIME_METHODS=Asyncify,FS \
|
||||
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick,_app_web_launch_practice,_app_web_extension_host,_app_web_extension_break_now,_app_web_extension_breaks_enabled,_app_web_extension_break_timer_enabled,_app_web_extension_break_timer_limit_s,_app_web_extension_break_timer_duration_s,_app_web_extension_break_timer_postpone_s,_app_web_extension_break_timer_max_prompts,_app_web_extension_break_timer_show_skip,_app_web_extension_break_timer_show_postpone,_app_web_extension_open_break_settings,_app_web_extension_open_habits,_app_web_test_save_onboarding_state,_app_web_test_onboarding_state,_app_web_test_show_first_run_guide,_app_web_test_first_run_guide_active,_app_web_test_first_run_guide_step,_app_web_test_first_run_guide_text_clipped,_app_web_test_first_run_guide_next_x,_app_web_test_first_run_guide_next_y,_app_web_test_first_run_guide_close_x,_app_web_test_first_run_guide_close_y,_app_web_test_first_run_guide_anchor_x,_app_web_test_first_run_guide_anchor_y,_app_web_test_first_run_guide_anchor_w,_app_web_test_first_run_guide_anchor_h,_app_web_test_sync_key_state,_app_web_test_import_sync_key,_app_web_test_habits_click_x,_app_web_test_habits_click_y,_app_web_test_show_practice_home,_app_web_test_practice_selected,_app_web_test_practice_tab,_app_web_test_complete_practice,_app_web_test_completion_stage,_app_web_test_completed_practice_persisted,_app_web_test_screen,_app_web_test_route_transition_active,_app_web_test_practice_start_click_x,_app_web_test_practice_start_click_y,_app_web_test_practice_action_click_x,_app_web_test_practice_action_click_y,_app_web_test_sun_salutation_control_x,_app_web_test_sun_salutation_control_y,_app_web_test_sun_salutation_step,_app_web_test_sun_salutation_ticks,_app_web_test_sun_salutation_paused,_app_web_test_show_appearance,_app_web_test_control_x,_app_web_test_control_y,_app_web_test_control_width,_app_web_test_control_height,_app_web_test_enable_extension_breaks \
|
||||
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick,_app_web_launch_practice,_app_web_extension_host,_app_web_extension_break_now,_app_web_extension_breaks_enabled,_app_web_extension_break_timer_enabled,_app_web_extension_break_timer_limit_s,_app_web_extension_break_timer_duration_s,_app_web_extension_break_timer_postpone_s,_app_web_extension_break_timer_max_prompts,_app_web_extension_break_timer_show_skip,_app_web_extension_break_timer_show_postpone,_app_web_extension_open_break_settings,_app_web_extension_open_habits,_app_web_test_save_onboarding_state,_app_web_test_onboarding_state,_app_web_test_show_first_run_guide,_app_web_test_first_run_guide_active,_app_web_test_first_run_guide_step,_app_web_test_first_run_guide_text_clipped,_app_web_test_first_run_guide_next_x,_app_web_test_first_run_guide_next_y,_app_web_test_first_run_guide_close_x,_app_web_test_first_run_guide_close_y,_app_web_test_first_run_guide_anchor_x,_app_web_test_first_run_guide_anchor_y,_app_web_test_first_run_guide_anchor_w,_app_web_test_first_run_guide_anchor_h,_app_web_test_sync_key_state,_app_web_test_import_sync_key,_app_web_test_habits_click_x,_app_web_test_habits_click_y,_app_web_test_show_practice_home,_app_web_test_practice_selected,_app_web_test_practice_tab,_app_web_test_complete_practice,_app_web_test_completion_stage,_app_web_test_completed_practice_persisted,_app_web_test_screen,_app_web_test_route_transition_active,_app_web_test_practice_start_click_x,_app_web_test_practice_start_click_y,_app_web_test_practice_action_click_x,_app_web_test_practice_action_click_y,_app_web_test_sun_salutation_control_x,_app_web_test_sun_salutation_control_y,_app_web_test_sun_salutation_step,_app_web_test_sun_salutation_ticks,_app_web_test_sun_salutation_paused,_app_web_test_show_appearance,_app_web_test_prepare_music,_app_web_test_music_button_x,_app_web_test_music_button_y,_app_web_test_control_x,_app_web_test_control_y,_app_web_test_control_width,_app_web_test_control_height,_app_web_test_enable_extension_breaks \
|
||||
--preload-file locales --preload-file assets
|
||||
|
||||
$(WEB_TARGET): src/web_shell.html $(WEB_BOOT_JS) $(WEB_JS_TARGET) manifest.json $(WEB_ASSET_FILES) | $(WEB_DIST_DIR)
|
||||
@@ -2366,7 +2371,7 @@ $(WEB_CANVAS_TARGET): | zi-check
|
||||
-sFORCE_FILESYSTEM=1 -sFETCH=1 -sUSE_ZLIB=1 -lidbfs.js \
|
||||
-sALLOW_MEMORY_GROWTH=1 -sINITIAL_MEMORY=268435456 -sSTACK_SIZE=33554432 \
|
||||
-sEXPORTED_RUNTIME_METHODS=Asyncify,FS \
|
||||
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick,_app_web_launch_practice,_app_web_extension_host,_app_web_extension_break_now,_app_web_extension_breaks_enabled,_app_web_extension_break_timer_enabled,_app_web_extension_break_timer_limit_s,_app_web_extension_break_timer_duration_s,_app_web_extension_break_timer_postpone_s,_app_web_extension_break_timer_max_prompts,_app_web_extension_break_timer_show_skip,_app_web_extension_break_timer_show_postpone,_app_web_extension_open_break_settings,_app_web_extension_open_habits,_app_web_test_save_onboarding_state,_app_web_test_onboarding_state,_app_web_test_show_first_run_guide,_app_web_test_first_run_guide_active,_app_web_test_first_run_guide_step,_app_web_test_first_run_guide_text_clipped,_app_web_test_first_run_guide_next_x,_app_web_test_first_run_guide_next_y,_app_web_test_first_run_guide_close_x,_app_web_test_first_run_guide_close_y,_app_web_test_first_run_guide_anchor_x,_app_web_test_first_run_guide_anchor_y,_app_web_test_first_run_guide_anchor_w,_app_web_test_first_run_guide_anchor_h,_app_web_test_sync_key_state,_app_web_test_import_sync_key,_app_web_test_habits_click_x,_app_web_test_habits_click_y,_app_web_test_show_practice_home,_app_web_test_practice_selected,_app_web_test_practice_tab,_app_web_test_complete_practice,_app_web_test_completion_stage,_app_web_test_completed_practice_persisted,_app_web_test_screen,_app_web_test_route_transition_active,_app_web_test_practice_start_click_x,_app_web_test_practice_start_click_y,_app_web_test_practice_action_click_x,_app_web_test_practice_action_click_y,_app_web_test_sun_salutation_control_x,_app_web_test_sun_salutation_control_y,_app_web_test_sun_salutation_step,_app_web_test_sun_salutation_ticks,_app_web_test_sun_salutation_paused,_app_web_test_show_appearance,_app_web_test_control_x,_app_web_test_control_y,_app_web_test_control_width,_app_web_test_control_height,_app_web_test_enable_extension_breaks \
|
||||
-sEXPORTED_FUNCTIONS=_main,_malloc,_free,_app_web_get_play_in_background,_app_web_set_backgrounded,_app_web_background_tick,_app_web_launch_practice,_app_web_extension_host,_app_web_extension_break_now,_app_web_extension_breaks_enabled,_app_web_extension_break_timer_enabled,_app_web_extension_break_timer_limit_s,_app_web_extension_break_timer_duration_s,_app_web_extension_break_timer_postpone_s,_app_web_extension_break_timer_max_prompts,_app_web_extension_break_timer_show_skip,_app_web_extension_break_timer_show_postpone,_app_web_extension_open_break_settings,_app_web_extension_open_habits,_app_web_test_save_onboarding_state,_app_web_test_onboarding_state,_app_web_test_show_first_run_guide,_app_web_test_first_run_guide_active,_app_web_test_first_run_guide_step,_app_web_test_first_run_guide_text_clipped,_app_web_test_first_run_guide_next_x,_app_web_test_first_run_guide_next_y,_app_web_test_first_run_guide_close_x,_app_web_test_first_run_guide_close_y,_app_web_test_first_run_guide_anchor_x,_app_web_test_first_run_guide_anchor_y,_app_web_test_first_run_guide_anchor_w,_app_web_test_first_run_guide_anchor_h,_app_web_test_sync_key_state,_app_web_test_import_sync_key,_app_web_test_habits_click_x,_app_web_test_habits_click_y,_app_web_test_show_practice_home,_app_web_test_practice_selected,_app_web_test_practice_tab,_app_web_test_complete_practice,_app_web_test_completion_stage,_app_web_test_completed_practice_persisted,_app_web_test_screen,_app_web_test_route_transition_active,_app_web_test_practice_start_click_x,_app_web_test_practice_start_click_y,_app_web_test_practice_action_click_x,_app_web_test_practice_action_click_y,_app_web_test_sun_salutation_control_x,_app_web_test_sun_salutation_control_y,_app_web_test_sun_salutation_step,_app_web_test_sun_salutation_ticks,_app_web_test_sun_salutation_paused,_app_web_test_show_appearance,_app_web_test_prepare_music,_app_web_test_music_button_x,_app_web_test_music_button_y,_app_web_test_control_x,_app_web_test_control_y,_app_web_test_control_width,_app_web_test_control_height,_app_web_test_enable_extension_breaks \
|
||||
--preload-file locales --preload-file assets
|
||||
perl -0pe 's#\{\{\{ APP_SCRIPT \}\}\}#$(WEB_CANVAS_APP_SCRIPT)#g; s/WEB_CACHE_BUSTER/$(WEB_CACHE_BUSTER)/g' src/web_shell.html > $@
|
||||
cp $(WEB_BOOT_JS) $(WEB_CANVAS_DIR)/index_boot.js
|
||||
@@ -2547,7 +2552,13 @@ android-avd:
|
||||
|
||||
android-smoke:
|
||||
@mkdir -p build/android
|
||||
sh scripts/android-smoke-test.sh "$(ANDROID_SDK)" "$(ANDROID_APP_ID)" "$(ANDROID_ACTIVITY)"
|
||||
sh scripts/android-smoke-test.sh "$(ANDROID_SDK)" "$(ANDROID_DEBUG_APP_ID)" "$(ANDROID_ACTIVITY)"
|
||||
|
||||
.PHONY: android-smoke-script-test
|
||||
android-smoke-script-test:
|
||||
python3 tests/android_smoke_script_test.py
|
||||
|
||||
test: android-smoke-script-test
|
||||
|
||||
android-audio-e2e:
|
||||
bash scripts/android-audio-e2e.sh
|
||||
|
||||
@@ -53,8 +53,8 @@ android {
|
||||
applicationId "xyz.waozi.inbe"
|
||||
minSdk 21
|
||||
targetSdk 36
|
||||
versionCode 131
|
||||
versionName "2.0.7"
|
||||
versionCode 132
|
||||
versionName "2.0.8"
|
||||
manifestPlaceholders = [
|
||||
inbeAppLabel: "Inner Breeze",
|
||||
inbeUsesCleartextTraffic: "false"
|
||||
@@ -79,6 +79,7 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig project.hasProperty('fDroidBuild') ? null : signingConfigs.release
|
||||
ndk.debugSymbolLevel 'FULL'
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
|
||||
@@ -49,6 +49,7 @@ file(GLOB ZIRAN_SOURCES CONFIGURE_DEPENDS
|
||||
"${ZIRAN_DIR}/cmd/zir-ir/*.c" "${ZIRAN_DIR}/cmd/zir-ir/*.h")
|
||||
find_program(HOST_MAKE NAMES make gmake REQUIRED)
|
||||
find_program(HOST_PYTHON NAMES python3 REQUIRED)
|
||||
find_program(HOST_CC NAMES cc gcc REQUIRED NO_CMAKE_FIND_ROOT_PATH)
|
||||
set(ZIRAN_BIN "${ZIRAN_BUILD_DIR}/bin/ziran")
|
||||
add_custom_target(app_build_laws
|
||||
COMMAND "${HOST_PYTHON}" "${REPO_ROOT}/scripts/check-version.py"
|
||||
@@ -69,6 +70,7 @@ add_custom_command(
|
||||
OUTPUT "${ZI2C_BIN}"
|
||||
BYPRODUCTS "${ZI2ZIR_BIN}"
|
||||
COMMAND "${HOST_MAKE}" -j1 -C "${ZIRAN_DIR}"
|
||||
"CC=${HOST_CC}" "HOST_CC=${HOST_CC}"
|
||||
"BUILD_DIR=${ZIRAN_BUILD_DIR}" all
|
||||
DEPENDS ${ZIRAN_SOURCES} "${ZIRAN_DIR}/Makefile"
|
||||
VERBATIM
|
||||
@@ -99,6 +101,7 @@ string(APPEND APP_ZIRAN_CHECK_DEFINES " ${APP_ZIRAN_ARCH}")
|
||||
# CMake needs the complete emitted import graph before it creates build rules.
|
||||
# Run the same required law gates before this initial source generation.
|
||||
execute_process(COMMAND "${HOST_MAKE}" -j1 -C "${ZIRAN_DIR}"
|
||||
"CC=${HOST_CC}" "HOST_CC=${HOST_CC}"
|
||||
"BUILD_DIR=${ZIRAN_BUILD_DIR}" all COMMAND_ERROR_IS_FATAL ANY)
|
||||
execute_process(COMMAND "${HOST_PYTHON}" "${REPO_ROOT}/scripts/check-version.py"
|
||||
WORKING_DIRECTORY "${REPO_ROOT}" COMMAND_ERROR_IS_FATAL ANY)
|
||||
|
||||
@@ -11,6 +11,8 @@ Changed
|
||||
- Refined Settings, Profile, Lists, habit cards, session controls, and mood check-in buttons. Desktop users can zoom with Ctrl and the mouse wheel.
|
||||
Fixed
|
||||
---
|
||||
- Music keeps playing when you switch tabs inside the app or leave practice customization.
|
||||
- Restored sound and music playback in the web app.
|
||||
- Appearance dropdown menus stay above the Layout card and other settings, keeping every option visible and selectable.
|
||||
- Practice Customize and How-to actions now open the correct pages, and carousel swipes reliably change practices.
|
||||
- Animated screens keep their controls visible, and navigation transitions finish before accepting the next action.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
Fixed
|
||||
---
|
||||
- Fixed an Android startup crash after upgrading from older versions, while preserving saved preferences and practice history.
|
||||
- Keep drawing the app when a device cannot allocate the graphics buffers used for screen transitions.
|
||||
@@ -1,5 +1,5 @@
|
||||
Package: inbe.waozi
|
||||
Version: 2.0.7
|
||||
Version: 2.0.8
|
||||
Architecture: arm64
|
||||
Maintainer: Waozi <[email protected]>
|
||||
Click-Version: 0.4
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.0.7" date="2026-10-01"/>
|
||||
<release version="2.0.8" date="2026-10-02"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "inbe",
|
||||
"title": "Inner Breeze",
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.8",
|
||||
"architecture": "arm64",
|
||||
"framework": "ubuntu-sdk-20.04",
|
||||
"description": "Syncable breathing, meditation, and habit practice app.",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 3,
|
||||
"name": "Inner Breeze",
|
||||
"short_name": "Inbe",
|
||||
"version": "2.0.7",
|
||||
"version": "2.0.8",
|
||||
"description": "Breathing, meditation, habit tracking, and encrypted sync.",
|
||||
"permissions": [
|
||||
"contextMenus"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.0.7" date="2026-10-01"/>
|
||||
<release version="2.0.8" date="2026-10-02"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -22,7 +22,7 @@
|
||||
<binary>inbe</binary>
|
||||
</provides>
|
||||
<releases>
|
||||
<release version="2.0.7" date="2026-10-01"/>
|
||||
<release version="2.0.8" date="2026-10-02"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.1"/>
|
||||
</component>
|
||||
@@ -6,7 +6,7 @@ description: |
|
||||
meditation, and habit tracking with visual and audio cues, meditation
|
||||
timers, habit counters, session history, and optional sync.
|
||||
|
||||
version: '2.0.7'
|
||||
version: '2.0.8'
|
||||
license: BSD-3-Clause
|
||||
base: core22
|
||||
confinement: strict
|
||||
|
||||
@@ -1,40 +1,90 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$root"
|
||||
sdk_root=${ANDROID_SDK_ROOT:-${ANDROID_HOME:-${1:-}}}
|
||||
app_id=${2:-xyz.waozi.inbe}
|
||||
app_id=${2:-xyz.waozi.inbe.debug}
|
||||
activity=${3:-xyz.waozi.inbe.MainActivity}
|
||||
serial=${ANDROID_SMOKE_SERIAL:-${ANDROID_EMULATOR_PORT:+emulator-$ANDROID_EMULATOR_PORT}}
|
||||
observations=${ANDROID_SMOKE_OBSERVATIONS:-15}
|
||||
interval=${ANDROID_SMOKE_INTERVAL:-1}
|
||||
logs=${ANDROID_SMOKE_LOG_DIR:-build/android}
|
||||
|
||||
if [ -z "$sdk_root" ]; then
|
||||
echo "android smoke: set ANDROID_SDK_ROOT or ANDROID_HOME"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
emulator="$sdk_root/emulator/emulator"
|
||||
if [ ! -x "$emulator" ]; then
|
||||
echo "android smoke: Android Emulator package is missing: $emulator"
|
||||
echo "android smoke: install it with: sdkmanager \"emulator\""
|
||||
exit 2
|
||||
fi
|
||||
|
||||
bash scripts/emulator.sh
|
||||
|
||||
adb_cmd="$sdk_root/platform-tools/adb"
|
||||
if [ ! -x "$adb_cmd" ]; then
|
||||
adb_cmd=adb
|
||||
fi
|
||||
|
||||
"$adb_cmd" -e wait-for-device
|
||||
"$adb_cmd" -e logcat -c || true
|
||||
${MAKE:-make} android-install ADB="$adb_cmd -e"
|
||||
sleep 5
|
||||
"$adb_cmd" -e shell am start -n "$app_id/$activity" >/dev/null
|
||||
sleep 3
|
||||
"$adb_cmd" -e logcat -d -t 400 > build/android/android-smoke-logcat.txt
|
||||
|
||||
if grep -E "FATAL EXCEPTION|Fatal signal|AndroidRuntime|DEBUG.*backtrace" build/android/android-smoke-logcat.txt >/dev/null; then
|
||||
echo "android smoke: FAIL; see build/android/android-smoke-logcat.txt"
|
||||
fail() {
|
||||
echo "android smoke: FAIL: $*; see $logs/android-smoke-logcat.txt" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -n "$sdk_root" ] || { echo 'android smoke: set ANDROID_SDK_ROOT or ANDROID_HOME' >&2; exit 2; }
|
||||
adb_cmd="$sdk_root/platform-tools/adb"
|
||||
[ -x "$adb_cmd" ] || adb_cmd=adb
|
||||
adb_run() {
|
||||
if [ -n "$serial" ]; then "$adb_cmd" -s "$serial" "$@"
|
||||
else "$adb_cmd" -e "$@"
|
||||
fi
|
||||
}
|
||||
case "$observations" in ''|*[!0-9]*) echo 'android smoke: observations must be a positive integer' >&2; exit 2;; esac
|
||||
[ "$observations" -gt 0 ] || exit 2
|
||||
mkdir -p "$logs"
|
||||
capture() {
|
||||
adb_run logcat -d -v threadtime > "$logs/android-smoke-logcat.txt" 2>&1 || true
|
||||
adb_run logcat -b crash -d > "$logs/android-smoke-crash.txt" 2>&1 || true
|
||||
adb_run shell dumpsys activity exit-info "$app_id" > "$logs/android-smoke-exit-info.txt" 2>&1 || true
|
||||
}
|
||||
trap capture EXIT
|
||||
|
||||
if [ "${ANDROID_SMOKE_SKIP_EMULATOR:-0}" != 1 ]; then
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY ANDROID_EMULATOR_HEADLESS=1 bash scripts/emulator.sh
|
||||
fi
|
||||
if [ -n "$serial" ]; then
|
||||
timeout 180 "$adb_cmd" -s "$serial" wait-for-device
|
||||
else
|
||||
timeout 180 "$adb_cmd" -e wait-for-device
|
||||
fi
|
||||
adb_run logcat -c
|
||||
if [ -n "${ANDROID_SMOKE_APK:-}" ]; then
|
||||
[ -f "$ANDROID_SMOKE_APK" ] || fail 'APK does not exist'
|
||||
adb_run install -r -t "$ANDROID_SMOKE_APK"
|
||||
else
|
||||
selector=-e
|
||||
if [ -n "$serial" ]; then selector="-s $serial"; fi
|
||||
${MAKE:-make} android-install ADB="$adb_cmd $selector"
|
||||
fi
|
||||
|
||||
echo "android smoke: PASS"
|
||||
start() {
|
||||
adb_run shell am start -W -n "$app_id/$activity" > "$logs/android-smoke-launch.txt" 2>&1 || fail 'activity could not start'
|
||||
if ! grep -q '^Status: ok' "$logs/android-smoke-launch.txt"; then
|
||||
cat "$logs/android-smoke-launch.txt" >&2
|
||||
fail 'activity launch did not succeed'
|
||||
fi
|
||||
}
|
||||
process() { adb_run shell pidof "$app_id" 2>/dev/null | tr -d '\r'; }
|
||||
observe() {
|
||||
count=0
|
||||
while [ "$count" -lt "$observations" ]; do
|
||||
sleep "$interval"
|
||||
current=$(process || true)
|
||||
[ -n "$current" ] || fail 'app process exited'
|
||||
[ "$current" = "$pid" ] || fail 'app process restarted unexpectedly'
|
||||
count=$((count + 1))
|
||||
done
|
||||
}
|
||||
foreground() {
|
||||
adb_run shell dumpsys activity activities > "$logs/android-smoke-activity.txt"
|
||||
grep -E 'mResumedActivity|topResumedActivity' "$logs/android-smoke-activity.txt" |
|
||||
grep -F "$app_id/" > /dev/null || fail 'app is not the resumed activity'
|
||||
}
|
||||
|
||||
adb_run shell am force-stop "$app_id"
|
||||
start
|
||||
pid=$(process || true)
|
||||
[ -n "$pid" ] || fail 'app exited during startup'
|
||||
observe
|
||||
foreground
|
||||
adb_run shell input keyevent KEYCODE_HOME
|
||||
observe
|
||||
start
|
||||
observe
|
||||
foreground
|
||||
echo "android smoke: PASS: $app_id survived startup and background/resume (PID $pid)"
|
||||
@@ -91,6 +91,12 @@ else
|
||||
QEMU_MEMORY_ARGS=()
|
||||
fi
|
||||
|
||||
if [ "${ANDROID_EMULATOR_HEADLESS:-0}" = 1 ]; then
|
||||
WINDOW_ARGS=(-no-window)
|
||||
else
|
||||
WINDOW_ARGS=()
|
||||
fi
|
||||
|
||||
EMULATOR_CMD="${ANDROID_SDK_ROOT}/emulator/emulator"
|
||||
if [ ! -x "$EMULATOR_CMD" ]; then
|
||||
EMULATOR_CMD="$(command -v emulator)"
|
||||
@@ -141,6 +147,7 @@ if [ "$SOFT_EMULATOR" -eq 1 ]; then
|
||||
-verbose > /tmp/emulator.log 2>&1 &
|
||||
else
|
||||
LD_LIBRARY_PATH="$EMULATOR_LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" "$EMULATOR_CMD" @"$AVD_NAME" \
|
||||
"${WINDOW_ARGS[@]}" \
|
||||
"${AUDIO_ARGS[@]}" \
|
||||
"${PORT_ARGS[@]}" \
|
||||
"${MEMORY_ARGS[@]}" \
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
// Observe real WebAudio nodes and the signal after the app's volume controls.
|
||||
// The analyser passes that signal through unchanged.
|
||||
function installMusicProbe() {
|
||||
const contexts = [];
|
||||
const sources = [];
|
||||
const connect = AudioNode.prototype.connect;
|
||||
AudioNode.prototype.connect = function (destination, ...args) {
|
||||
const record = contexts.find(item => item.context === this.context);
|
||||
if (record && destination === this.context.destination) {
|
||||
if (!record.analyser) {
|
||||
record.analyser = this.context.createAnalyser();
|
||||
record.analyser.fftSize = 2048;
|
||||
connect.call(record.analyser, destination);
|
||||
}
|
||||
connect.call(this, record.analyser, ...args);
|
||||
return destination;
|
||||
}
|
||||
return connect.call(this, destination, ...args);
|
||||
};
|
||||
for (const name of ['AudioContext', 'webkitAudioContext']) {
|
||||
const Original = globalThis[name];
|
||||
if (!Original) continue;
|
||||
globalThis[name] = new Proxy(Original, {
|
||||
construct(target, args) {
|
||||
const context = Reflect.construct(target, args);
|
||||
contexts.push({ context, analyser: null });
|
||||
const create = context.createBufferSource.bind(context);
|
||||
context.createBufferSource = () => {
|
||||
const source = create();
|
||||
const record = { id: sources.length, started: false, stopped: false, ended: false };
|
||||
sources.push(record);
|
||||
const start = source.start.bind(source);
|
||||
source.start = (...startArgs) => {
|
||||
start(...startArgs);
|
||||
record.started = true;
|
||||
};
|
||||
const stop = source.stop.bind(source);
|
||||
source.stop = (...stopArgs) => {
|
||||
stop(...stopArgs);
|
||||
record.stopped = true;
|
||||
};
|
||||
source.addEventListener('ended', () => { record.ended = true; });
|
||||
return source;
|
||||
};
|
||||
return context;
|
||||
}
|
||||
});
|
||||
}
|
||||
globalThis.__inbeMusicProbe = () => ({
|
||||
active: sources.filter(source => source.started && !source.stopped && !source.ended)
|
||||
.map(source => source.id),
|
||||
starts: sources.filter(source => source.started).length,
|
||||
stops: sources.filter(source => source.stopped).length,
|
||||
contexts: contexts.map(({ context, analyser }) => {
|
||||
const values = new Float32Array(2048);
|
||||
if (analyser) analyser.getFloatTimeDomainData(values);
|
||||
return {
|
||||
state: context.state,
|
||||
time: context.currentTime,
|
||||
rms: Math.sqrt(values.reduce((sum, value) => sum + value * value, 0) / values.length)
|
||||
};
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export const musicAudioInstrumentation = `(${installMusicProbe.toString()})()`;
|
||||
|
||||
export async function verifyMusicAcrossTabs({ evaluate, click, scroll, resize, callHook, settle }) {
|
||||
await resize(1280, 1600);
|
||||
await callHook('app_web_test_save_onboarding_state');
|
||||
await evaluate(`(() => {
|
||||
const sampleRate = 24000;
|
||||
const frames = sampleRate * 40;
|
||||
const bytes = new Uint8Array(44 + frames * 2);
|
||||
const view = new DataView(bytes.buffer);
|
||||
function text(offset, value) {
|
||||
for (let i = 0; i < value.length; i++) bytes[offset + i] = value.charCodeAt(i);
|
||||
}
|
||||
text(0, 'RIFF'); view.setUint32(4, bytes.length - 8, true);
|
||||
text(8, 'WAVE'); text(12, 'fmt '); view.setUint32(16, 16, true);
|
||||
view.setUint16(20, 1, true); view.setUint16(22, 1, true);
|
||||
view.setUint32(24, sampleRate, true); view.setUint32(28, sampleRate * 2, true);
|
||||
view.setUint16(32, 2, true); view.setUint16(34, 16, true);
|
||||
text(36, 'data'); view.setUint32(40, frames * 2, true);
|
||||
for (let i = 0; i < frames; i++)
|
||||
view.setInt16(44 + i * 2, Math.sin(i * 2 * Math.PI * 220 / sampleRate) * 6000, true);
|
||||
Module.FS.writeFile('/tmp/inbe-navigation.wav', bytes);
|
||||
// Seed the optional music pack with valid shipped Ogg data so Customize
|
||||
// exposes its preview control. The track being tested is the WAV above.
|
||||
Module.FS.mkdirTree('/unpackaged_assets/audio/Elijah_K');
|
||||
const ogg = Module.FS.readFile('/assets/sounds/bell.ogg');
|
||||
for (const name of ['deep-meditation', 'path-of-meditation', 'truth-of-silence'])
|
||||
Module.FS.writeFile('/unpackaged_assets/audio/Elijah_K/' + name + '.ogg', ogg);
|
||||
})()`);
|
||||
await callHook('app_web_test_prepare_music');
|
||||
await delay(250);
|
||||
|
||||
async function button(action) {
|
||||
await settle();
|
||||
let point;
|
||||
for (let attempt = 0; attempt < 4; attempt++) {
|
||||
// Entering Audio can suspend the first draw while cue files decode.
|
||||
// Wait for that draw and its actual control before choosing a position.
|
||||
const deadline = Date.now() + 10000;
|
||||
do {
|
||||
point = await evaluate(`(() => {
|
||||
const canvas = Module.canvas;
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
const busy = !!(Module.Asyncify?.state || Module.Asyncify?.currData);
|
||||
const rawX = busy ? -1 : Module._app_web_test_music_button_x(${action});
|
||||
const rawY = busy ? -1 : Module._app_web_test_music_button_y(${action});
|
||||
return { rawX, rawY, busy,
|
||||
screen: busy ? -1 : Module._app_web_test_screen(),
|
||||
x: rect.left + rawX * rect.width / canvas.width,
|
||||
y: rect.top + rawY * rect.height / canvas.height,
|
||||
right: rect.right, bottom: rect.bottom };
|
||||
})()`);
|
||||
if (!point.busy) break;
|
||||
await delay(100);
|
||||
} while (Date.now() < deadline);
|
||||
if (!point.busy && point.rawX < 0 && action >= 2 && action <= 5 && attempt === 0) {
|
||||
await button(10);
|
||||
continue;
|
||||
}
|
||||
if (!point.busy && point.rawX < 0 && (action === 0 || action === 1)) {
|
||||
await scroll(point.right * 0.7, point.bottom * 0.6, 400);
|
||||
await delay(600);
|
||||
continue;
|
||||
}
|
||||
if (point.rawX < 0 || point.rawY < 0 ||
|
||||
((action !== 0 && action !== 1) || point.y <= point.bottom * 0.75)) break;
|
||||
await scroll(point.x, point.bottom * 0.6, point.y - point.bottom * 0.65 + 100);
|
||||
await delay(600);
|
||||
}
|
||||
if (point.rawX < 0 || point.rawY < 0 || point.x > point.right || point.y > point.bottom)
|
||||
throw new Error(`music button ${action} is missing or clipped: ${JSON.stringify(point)}`);
|
||||
if (process.env.WEB_MUSIC_DEBUG) console.log('music click', action, point);
|
||||
await click(point.x, point.y);
|
||||
await delay(200);
|
||||
}
|
||||
|
||||
const probe = () => evaluate('globalThis.__inbeMusicProbe()');
|
||||
function audible(state) {
|
||||
return state.active.length === 1 && state.contexts.some(context =>
|
||||
context.state === 'running' && context.rms > 0.005);
|
||||
}
|
||||
async function playing(label, expected) {
|
||||
let state;
|
||||
const deadline = Date.now() + 10000;
|
||||
do {
|
||||
state = await probe();
|
||||
if (expected || audible(state)) break;
|
||||
await delay(100);
|
||||
} while (Date.now() < deadline);
|
||||
if (!audible(state) || (expected && (state.active[0] !== expected.active[0] ||
|
||||
state.starts !== expected.starts || state.stops !== expected.stops ||
|
||||
state.contexts[0].time <= expected.contexts[0].time))) {
|
||||
throw new Error(`music interrupted during ${label}: ${JSON.stringify({ expected, state })}`);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
await button(0);
|
||||
let previous = await playing('Audio preview');
|
||||
for (const [action, label] of [[2, 'Device'], [4, 'Appearance'], [5, 'About'],
|
||||
[3, 'Audio'], [6, 'Habits'], [8, 'Lists'], [7, 'Practices'], [10, 'Settings']]) {
|
||||
await button(action);
|
||||
previous = await playing(label, previous);
|
||||
}
|
||||
|
||||
await button(3);
|
||||
await button(0);
|
||||
const paused = await probe();
|
||||
if (paused.active.length !== 0 || paused.contexts.some(context => context.rms > 0.0001))
|
||||
throw new Error(`explicit music pause did not silence playback: ${JSON.stringify(paused)}`);
|
||||
await button(0);
|
||||
previous = await playing('explicit resume');
|
||||
|
||||
// Selecting another preview must replace the settings stream. Leaving
|
||||
// Customize must then preserve that new source, including its sample output.
|
||||
await button(7);
|
||||
await button(11);
|
||||
await button(1);
|
||||
const practice = await playing('Customize preview');
|
||||
if (practice.active[0] === previous.active[0] || practice.starts !== previous.starts + 1)
|
||||
throw new Error(`Customize did not replace the Audio preview: ${JSON.stringify(practice)}`);
|
||||
previous = practice;
|
||||
for (const [action, label] of [[12, 'leaving Customize'], [10, 'Settings'], [4, 'Appearance'],
|
||||
[6, 'Habits'], [8, 'Lists'], [7, 'Practices']]) {
|
||||
await button(action);
|
||||
previous = await playing(label, previous);
|
||||
}
|
||||
console.log('web music: real audio continues across internal tabs; pause and resume work');
|
||||
await resize(1280, 800);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { spawn } from 'node:child_process';
|
||||
import { inflateSync } from 'node:zlib';
|
||||
import { verifyAppearanceCanvas, verifySunSalutationCanvas } from './web-sun-salutation-test.mjs';
|
||||
import { verifyCanvasTextResolution } from './web-canvas-text-test.mjs';
|
||||
import { musicAudioInstrumentation, verifyMusicAcrossTabs } from './web-music-test.mjs';
|
||||
|
||||
if (typeof WebSocket === 'undefined') {
|
||||
console.error('web smoke: FAIL: this script needs the global WebSocket API. Use Node >= 21, or pass --experimental-websocket on Node 20.');
|
||||
@@ -978,6 +979,9 @@ async function firstRunGuideButtonTarget(client, kind) {
|
||||
y,
|
||||
rawX,
|
||||
rawY,
|
||||
guideActive: Module._app_web_test_first_run_guide_active(),
|
||||
guideStep: Module._app_web_test_first_run_guide_step(),
|
||||
transitionActive: Module._app_web_test_route_transition_active(),
|
||||
rect: { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom, width: rect.width, height: rect.height },
|
||||
logical: { width: logicalW, height: logicalH },
|
||||
canvas: { width: canvas.width, height: canvas.height }
|
||||
@@ -996,10 +1000,13 @@ async function firstRunGuideState(client, requireDebug = true, requireActive = f
|
||||
state = await pageJson(client, `(() => ({
|
||||
active: Module._app_web_test_first_run_guide_active(),
|
||||
step: Module._app_web_test_first_run_guide_step(),
|
||||
clipped: Module._app_web_test_first_run_guide_text_clipped()
|
||||
clipped: Module._app_web_test_first_run_guide_text_clipped(),
|
||||
nextX: Module._app_web_test_first_run_guide_next_x(),
|
||||
nextY: Module._app_web_test_first_run_guide_next_y()
|
||||
}))()`);
|
||||
if ((!requireActive || (state?.active === 1 && state?.step === 0)) &&
|
||||
(!requireDebug || state?.clipped !== -1))
|
||||
(!requireDebug || (state?.clipped !== -1 &&
|
||||
state?.nextX >= 0 && state?.nextY >= 0)))
|
||||
return state;
|
||||
await waitAnimationFrames(client, 1);
|
||||
}
|
||||
@@ -1046,7 +1053,7 @@ async function verifyFirstRunGuideCanvasFlow(client) {
|
||||
return { ok: true };
|
||||
})()))()`, true);
|
||||
if (state?.ok) {
|
||||
await waitAnimationFrames(client, 2);
|
||||
await waitRouteTransition(client);
|
||||
state = { ok: true, ...(await firstRunGuideState(client, true, true)) };
|
||||
}
|
||||
if (!state?.ok || state.active !== 1 || state.step !== 0)
|
||||
@@ -1682,6 +1689,36 @@ async function sunSalutationChecks(client, browser) {
|
||||
await verifySunSalutationCanvas(driver);
|
||||
}
|
||||
|
||||
async function musicChecks(client) {
|
||||
try {
|
||||
await verifyMusicAcrossTabs({
|
||||
settle: () => waitRouteTransition(client),
|
||||
evaluate: (expression, awaitPromise = false) => pageJson(client, expression, awaitPromise),
|
||||
callHook: (name, args = []) => pageJson(client, `(async () => {
|
||||
${wasmHookEvalHelper()}
|
||||
await callWasmHook(${JSON.stringify(name)}, ${JSON.stringify(args)});
|
||||
})()`, true),
|
||||
resize: (width, height) => client.send('Emulation.setDeviceMetricsOverride', {
|
||||
width, height, deviceScaleFactor: 1, mobile: false
|
||||
}),
|
||||
click: (x, y) => dispatchCanvasClick(client, x, y),
|
||||
scroll: async (x, y, deltaY) => {
|
||||
await client.send('Input.dispatchMouseEvent', { type: 'mouseMoved', x, y });
|
||||
await waitAnimationFrames(client, 2);
|
||||
await client.send('Input.dispatchMouseEvent', {
|
||||
type: 'mouseWheel', x, y, deltaX: 0, deltaY
|
||||
});
|
||||
await waitAnimationFrames(client, 6);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
const screenshot = await client.send('Page.captureScreenshot', { format: 'png', fromSurface: true });
|
||||
writeFileSync('build/music-browser-failure.png', Buffer.from(screenshot.data, 'base64'));
|
||||
const recent = client.events.map(eventText).filter(text => /AUDIO|music|decode/i.test(text)).slice(-8);
|
||||
throw new Error(`${error.message}; audio logs: ${recent.join(' | ')}`);
|
||||
}
|
||||
}
|
||||
|
||||
// The same browser flows run through Firefox's WebDriver BiDi transport.
|
||||
// This facade translates only the commands used by these tests.
|
||||
function firefoxPageClient(bidi, context) {
|
||||
@@ -1785,6 +1822,7 @@ try {
|
||||
'--no-default-browser-check',
|
||||
'--disable-background-networking',
|
||||
'--disable-dev-shm-usage',
|
||||
'--mute-audio',
|
||||
'--enable-unsafe-swiftshader',
|
||||
'--ignore-gpu-blocklist',
|
||||
'--enable-webgl',
|
||||
@@ -1817,8 +1855,16 @@ try {
|
||||
await client.send('Runtime.enable');
|
||||
await client.send('Log.enable');
|
||||
await client.send('Page.enable');
|
||||
await client.send('Page.addScriptToEvaluateOnNewDocument', { source: musicAudioInstrumentation });
|
||||
if (process.env.WEB_SMOKE_CPU_THROTTLE)
|
||||
await client.send('Emulation.setCPUThrottlingRate', {
|
||||
rate: Number(process.env.WEB_SMOKE_CPU_THROTTLE)
|
||||
});
|
||||
await client.send('Page.navigate', { url: `http://127.0.0.1:${port}/index.html` });
|
||||
await waitForHealthyPage(client);
|
||||
await musicChecks(client);
|
||||
if (process.env.WEB_SMOKE_CPU_THROTTLE)
|
||||
await client.send('Emulation.setCPUThrottlingRate', { rate: 1 });
|
||||
await verifyRenderingLive(client);
|
||||
await verifyReloadPersistence(client);
|
||||
await verifyAppSettingsReloadPersistence(client);
|
||||
|
||||
@@ -78,6 +78,7 @@ GetTime :: () -> float64 #foreign c;
|
||||
#import, file "../screens/profile_screen.zi";
|
||||
#import, file "../screens/profile_social.zi";
|
||||
#import, file "../screens/settings/settings_screen.zi";
|
||||
#import, file "../screens/settings/settings_audio.zi";
|
||||
#import, file "../screens/settings/settings_data_ui.zi";
|
||||
#import, file "../screens/settings/settings_sync_account_impl.zi";
|
||||
#import, file "../screens/settings/settings_theme.zi";
|
||||
@@ -897,6 +898,8 @@ updateapp :: (app: *InnerBreeze) {
|
||||
i += 1
|
||||
}
|
||||
}
|
||||
// Streams need fresh buffers even when their controls are on another tab.
|
||||
settings_audio_update_preview(app)
|
||||
if app.practice_coming_soon_ticks > 0 {
|
||||
app.practice_coming_soon_ticks -= 1
|
||||
}
|
||||
@@ -1292,6 +1295,7 @@ app_destroy :: (vapp: *void) {
|
||||
i += 1
|
||||
}
|
||||
}
|
||||
settings_audio_stop_preview(app)
|
||||
app_audio_shutdown(app)
|
||||
app.* = InnerBreeze.{}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
c :: #system_library "c";
|
||||
#import, file "current_app.zi";
|
||||
#import, file "locale.zi";
|
||||
#import, file "app_settings.zi";
|
||||
#import, file "../storage/account_types.zi";
|
||||
#import, file "../storage/storage_core.zi";
|
||||
@@ -694,6 +695,66 @@ using AppThemeSource;
|
||||
app_refresh_theme(app)
|
||||
app_observe_direct_route_change(app, before)
|
||||
}
|
||||
// Browser tests supply a real WAV in the virtual filesystem. Playback
|
||||
// starts through the same visible controls a person uses.
|
||||
#program_export
|
||||
app_web_test_prepare_music :: () {
|
||||
app := CurrentApp()
|
||||
if app == null {
|
||||
return
|
||||
}
|
||||
before := app_current_route(app)
|
||||
if app.modal.active != 0 {
|
||||
app_close_modal(app)
|
||||
}
|
||||
app.tutorial_seen = 1
|
||||
app.music_volume = 60
|
||||
app.audio_custom_music_count = 1
|
||||
AppCopyText("/tmp/inbe-navigation.wav", app.audio_custom_music[0].path[:])
|
||||
AppCopyText("Navigation test track", app.audio_custom_music[0].title[:])
|
||||
app.exercise_type = EXERCISE_MEDITATION
|
||||
app.meditation.music_track = AUDIO_BUILTIN_MUSIC_COUNT
|
||||
app.meditation.music_practice_tracks[EXERCISE_MEDITATION] = AUDIO_BUILTIN_MUSIC_COUNT
|
||||
app.practice_tab = PRACTICE_TAB_PLAY
|
||||
app.practice_config_tab = 0
|
||||
app.settings_tab = SETTINGS_TAB_AUDIO
|
||||
app.settings_overview = 0
|
||||
app.settings_scroll = 0
|
||||
app.breathing.screen = ScreenSettings
|
||||
app_observe_direct_route_change(app, before)
|
||||
}
|
||||
web_test_music_button_target :: (action: s32) -> Vector2 {
|
||||
app := CurrentApp()
|
||||
keys: [13]string = .{"", "meditation_music_test_button",
|
||||
"settings_tab_device", "settings_tab_audio",
|
||||
"settings_section_appearance", "settings_tab_about",
|
||||
"tab_habits", "tab_practice", "tab_elist", "tab_profile",
|
||||
"settings_title", "practice_configure_button", "back_button"}
|
||||
if app == null || action < 0 || action >= cast(s32)keys.count {
|
||||
return Vector2.{-1, -1}
|
||||
}
|
||||
label := LocaleText(keys[action])
|
||||
index: s32 = 0
|
||||
while index < TreeCount(app.ui.session) {
|
||||
node := TreeNodeAt(app.ui.session, index)
|
||||
if node.interactive && !node.disabled &&
|
||||
((action == 0 && node.focus_id == 18400) ||
|
||||
(action != 0 && node.semantic_label == label)) {
|
||||
return WorldToScreen(Vector2.{node.bounds.x + node.bounds.width / 2,
|
||||
node.bounds.y + node.bounds.height / 2}, app.camera)
|
||||
}
|
||||
index += 1
|
||||
}
|
||||
return Vector2.{-1, -1}
|
||||
}
|
||||
#program_export
|
||||
app_web_test_music_button_x :: (action: s32) -> s32 {
|
||||
return cast(s32)web_test_music_button_target(action).x
|
||||
}
|
||||
#program_export
|
||||
app_web_test_music_button_y :: (action: s32) -> s32 {
|
||||
return cast(s32)web_test_music_button_target(action).y
|
||||
}
|
||||
web_test_control_bounds :: (focus_id: s32) -> Rectangle {
|
||||
app := CurrentApp()
|
||||
if app == null {
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
#define APP_VERSION_MAJOR 2
|
||||
#define APP_VERSION_MINOR 0
|
||||
#define APP_VERSION_PATCH 7
|
||||
#define APP_VERSION_STRING "2.0.7"
|
||||
#define APP_VERSION_PATCH 8
|
||||
#define APP_VERSION_STRING "2.0.8"
|
||||
|
||||
#endif
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// Generated by update_version.sh from CHANGELOG.md. Do not edit by hand.
|
||||
VersionMajor :: 2
|
||||
VersionMinor :: 0
|
||||
VersionPatch :: 7
|
||||
VersionString :: "2.0.7"
|
||||
VersionPatch :: 8
|
||||
VersionString :: "2.0.8"
|
||||
@@ -50,6 +50,7 @@ LOG_INFO :: 3;
|
||||
LOG_WARNING :: 4;
|
||||
NativeTraceLog :: (level: s32, message: *u8, args: ..any) #foreign c "TraceLog";
|
||||
app_audio_ensure_ready :: (app: *InnerBreeze) #foreign c;
|
||||
settings_audio_stop_preview :: (app: *InnerBreeze) #foreign c;
|
||||
data_root_host_buffer :: () -> *u8 {
|
||||
if !AppCopyText(data_root(), data_root_text[:]) {
|
||||
return null
|
||||
@@ -523,6 +524,7 @@ test_track :: (app: *InnerBreeze) {
|
||||
set_status(app, LocaleText("meditation_music_test_stopped"))
|
||||
return
|
||||
}
|
||||
settings_audio_stop_preview(app)
|
||||
track = app.meditation.music_track
|
||||
if track < 0 || track >= app_audio_music_count(app) {
|
||||
track = 0
|
||||
@@ -546,10 +548,12 @@ meditation_music_start_session :: (app: *InnerBreeze) {
|
||||
return
|
||||
}
|
||||
|
||||
settings_audio_stop_preview(app)
|
||||
sanitize_practice_music(app)
|
||||
practice = practice_clamp_id(app.exercise_type)
|
||||
track = app.meditation.music_practice_tracks[practice]
|
||||
if track == AUDIO_MUSIC_NONE {
|
||||
meditation_music_stop(app)
|
||||
return
|
||||
}
|
||||
if load_track(app, track) == 0 {
|
||||
@@ -568,10 +572,6 @@ meditation_music_update :: (app: *InnerBreeze) {
|
||||
return
|
||||
}
|
||||
PollRuntimeAssetDownload(*app.meditation.music_download)
|
||||
if app.meditation.music_test_playing != 0 && ((app.breathing.screen == ScreenStart && app.practice_tab == PRACTICE_TAB_CONFIG) || app.breathing.screen == ScreenPracticeConfig || app.breathing.screen == ScreenManual || app.breathing.screen == ScreenSettings) == false {
|
||||
meditation_music_stop(app)
|
||||
return
|
||||
}
|
||||
|
||||
if app.meditation.music_download.status == AssetDownloadStatus.Ready && app.meditation.music_archive_extracted == 0 {
|
||||
archive_path(app, *archive_file_path[0], size_of(type_of(archive_file_path)))
|
||||
@@ -690,7 +690,8 @@ meditation_music_draw_practice_settings :: (app: *InnerBreeze,
|
||||
dropdown_pick := Dropdown(CurrentApp().ui.session, DropdownProps.{.id = cast(s32)451 + practice,
|
||||
.bounds = Rectangle.{cast(float32)content_x, cast(float32)(y.* + AppScale(26)), cast(float32)content_w, cast(float32)AppScale(48)},
|
||||
.selected_index = selection}, track_options[:track_count + 1])
|
||||
if dropdown_pick.node > 0 {
|
||||
if dropdown_pick.changed {
|
||||
selection = dropdown_pick.selected_index
|
||||
if selection <= 0 {
|
||||
app.meditation.music_practice_tracks[practice] = AUDIO_MUSIC_NONE
|
||||
app.meditation.music_practice_mask &= ~(1 << practice)
|
||||
|
||||
@@ -43,5 +43,5 @@ meditation_practice_update :: (app: *InnerBreeze) {
|
||||
|
||||
#program_export
|
||||
meditation_practice_leave_config :: (app: *InnerBreeze) {
|
||||
meditation_music_unload(app)
|
||||
unused app
|
||||
}
|
||||
@@ -79,8 +79,8 @@ meditation_start_seconds :: (app: *InnerBreeze, seconds: s32) {
|
||||
app.volume_popup_active = 0
|
||||
app_close_modal(app)
|
||||
app_switch_screen(app, ScreenMeditation)
|
||||
app_play_bell_cue(app, 1.0f)
|
||||
meditation_music_start_session(app)
|
||||
app_play_bell_cue(app, 1.0f)
|
||||
practice_background_start(app, EXERCISE_MEDITATION)
|
||||
}
|
||||
|
||||
|
||||
@@ -168,6 +168,7 @@ settings_audio_cue_sound :: (app: *InnerBreeze, cue: s32) -> SoundHandle {
|
||||
return empty
|
||||
}
|
||||
|
||||
#program_export
|
||||
settings_audio_stop_preview :: (app: *InnerBreeze) {
|
||||
if app != null {
|
||||
if app.breath_in_sound.frame_count != 0 {
|
||||
@@ -195,8 +196,9 @@ settings_audio_stop_preview :: (app: *InnerBreeze) {
|
||||
audio_preview_index = -1
|
||||
}
|
||||
|
||||
settings_audio_update_preview :: () {
|
||||
if audio_preview_music_loaded != 0 {
|
||||
settings_audio_update_preview :: (app: *InnerBreeze) {
|
||||
if app != null && audio_preview_music_loaded != 0 {
|
||||
audio_set_music_volume(audio_preview_music, settings_audio_music_volume(app))
|
||||
audio_update_music(audio_preview_music)
|
||||
}
|
||||
}
|
||||
@@ -294,6 +296,7 @@ settings_audio_toggle_music_preview :: (app: *InnerBreeze, index: s32) {
|
||||
settings_screen_set_status_error(LocaleText("audio_preview_failed"))
|
||||
return
|
||||
}
|
||||
meditation_music_unload(app)
|
||||
settings_audio_stop_preview(app)
|
||||
audio_preview_music = audio_load_music(AppTextFromCString(*path[0], FS_PATH_MAX))
|
||||
if !audio_music_valid(audio_preview_music) {
|
||||
@@ -1022,7 +1025,6 @@ draw_music_attribution :: (x: s32, w: s32, track: s32, y: *s32) {
|
||||
|
||||
settings_audio_draw :: (app: *InnerBreeze, x: s32, w: s32, y: *s32) {
|
||||
app_audio_ensure_ready(app)
|
||||
settings_audio_update_preview()
|
||||
settings_audio_draw_output(app, x, w, y)
|
||||
settings_audio_draw_sounds(app, x, w, y)
|
||||
settings_audio_draw_music(app, x, w, y)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#import, file "../../app/app_modal_state.zi";
|
||||
#import, file "../../app/locale.zi";
|
||||
#import, file "../../app/metrics.zi";
|
||||
#import, file "../../practices/meditation/meditation_music.zi";
|
||||
#import, file "settings_types.zi";
|
||||
#import, file "settings_theme.zi";
|
||||
#import, file "settings_device.zi";
|
||||
@@ -102,9 +101,6 @@ settings_screen_prepare :: (app: *InnerBreeze) {
|
||||
if app == null { return }
|
||||
settings_data_handle_import(app)
|
||||
settings_audio_handle_import(app)
|
||||
if app.settings_tab == SETTINGS_TAB_AUDIO {
|
||||
meditation_music_update(app)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsScreenTabAt :: (position: s32) -> s32 {
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Exercise launch failures and process deaths without a device or display."""
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
fake_adb = '''#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import sys
|
||||
path = Path(os.environ['SMOKE_STATE'])
|
||||
state = json.loads(path.read_text()) if path.exists() else {'calls': [], 'polls': 0, 'home': False}
|
||||
args = sys.argv[1:]
|
||||
assert args[:2] == ['-s', 'emulator-5584'], args
|
||||
args = args[2:]
|
||||
state['calls'].append(args)
|
||||
mode = os.environ['SMOKE_CASE']
|
||||
if args[:2] == ['shell', 'pidof']:
|
||||
assert args[2] == 'xyz.waozi.inbe.debug', args
|
||||
state['polls'] += 1
|
||||
dead = mode == 'startup_crash' or (mode == 'crash' and state['polls'] > 1) or (mode == 'background_crash' and state['home'])
|
||||
if not dead:
|
||||
print('84' if mode == 'restart' and state['polls'] > 1 else '42')
|
||||
elif args[:3] == ['shell', 'am', 'start']:
|
||||
assert 'xyz.waozi.inbe.debug/xyz.waozi.inbe.MainActivity' in args, args
|
||||
print('Error type 3: activity does not exist' if mode == 'launch_error' else 'Status: ok')
|
||||
elif args[:3] == ['shell', 'input', 'keyevent']:
|
||||
state['home'] = True
|
||||
elif args[:4] == ['shell', 'dumpsys', 'activity', 'activities']:
|
||||
print('mResumedActivity: other.app/.Activity' if mode == 'not_foreground' else 'mResumedActivity: xyz.waozi.inbe.debug/.MainActivity')
|
||||
elif args[:1] == ['logcat']:
|
||||
print('E AndroidRuntime: diagnostic from an unrelated process')
|
||||
path.write_text(json.dumps(state))
|
||||
'''
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="android-smoke-", dir=root / "build") as directory:
|
||||
work = Path(directory)
|
||||
sdk = work / "sdk"
|
||||
(sdk / "platform-tools").mkdir(parents=True)
|
||||
adb = sdk / "platform-tools/adb"
|
||||
adb.write_text(fake_adb)
|
||||
adb.chmod(0o755)
|
||||
apk = work / "app.apk"
|
||||
apk.touch()
|
||||
for mode in ("healthy", "launch_error", "startup_crash", "crash",
|
||||
"restart", "background_crash", "not_foreground"):
|
||||
state = work / f"{mode}.json"
|
||||
env = os.environ.copy()
|
||||
env.pop("DISPLAY", None)
|
||||
env.pop("WAYLAND_DISPLAY", None)
|
||||
env.update(ANDROID_HOME=str(sdk), ANDROID_SDK_ROOT=str(sdk),
|
||||
ANDROID_SMOKE_SKIP_EMULATOR="1", ANDROID_SMOKE_APK=str(apk),
|
||||
ANDROID_SMOKE_SERIAL="emulator-5584",
|
||||
ANDROID_SMOKE_OBSERVATIONS="2", ANDROID_SMOKE_INTERVAL="0",
|
||||
ANDROID_SMOKE_LOG_DIR=str(work / mode),
|
||||
SMOKE_STATE=str(state), SMOKE_CASE=mode)
|
||||
result = subprocess.run(["sh", str(root / "scripts/android-smoke-test.sh")],
|
||||
cwd=root, env=env, capture_output=True, text=True)
|
||||
assert (result.returncode == 0) == (mode == "healthy"), (mode, result.stdout, result.stderr)
|
||||
calls = json.loads(state.read_text())["calls"]
|
||||
assert ["install", "-r", "-t", str(apk)] in calls
|
||||
assert (work / mode / "android-smoke-logcat.txt").exists()
|
||||
print("Android smoke: launch status, correct app ID, process death/restart and resume checks passed")
|
||||
@@ -7,6 +7,11 @@ host_leave_practice_config :: (app: *void) {
|
||||
unused app
|
||||
}
|
||||
|
||||
#program_export "settings_audio_stop_preview"
|
||||
host_stop_audio_preview :: (app: *void) {
|
||||
unused app
|
||||
}
|
||||
|
||||
#program_export "profile_social_load_friends_cache"
|
||||
host_load_friends_cache :: (app: *void) {
|
||||
unused app
|
||||
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
-- Inbe 1.8.9 schema_create SQL, extracted from src/storage/db.c.
|
||||
-- Upstream commit: 5cdfa63d6ad9989cc1d51af5edb1d067cf453176
|
||||
PRAGMA journal_mode=DELETE;
|
||||
PRAGMA foreign_keys=ON;
|
||||
CREATE TABLE IF NOT EXISTS meta( key TEXT PRIMARY KEY, value TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS users( id TEXT PRIMARY KEY, created_at INTEGER NOT NULL, kind TEXT NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS settings( user_id TEXT NOT NULL, key TEXT NOT NULL, value TEXT NOT NULL, updated_at INTEGER NOT NULL, PRIMARY KEY(user_id,key));
|
||||
CREATE TABLE IF NOT EXISTS social_snapshots( user_id TEXT NOT NULL, kind TEXT NOT NULL, json TEXT NOT NULL, updated_at INTEGER NOT NULL, PRIMARY KEY(user_id,kind));
|
||||
CREATE TABLE IF NOT EXISTS sessions( id TEXT PRIMARY KEY, user_id TEXT NOT NULL, started_at INTEGER NOT NULL, local_date INTEGER NOT NULL, topic INTEGER NOT NULL DEFAULT 0, activity INTEGER NOT NULL DEFAULT 0, source TEXT NOT NULL, imported_at INTEGER NOT NULL, rounds_hash INTEGER NOT NULL, deleted_at INTEGER NOT NULL DEFAULT 0, updated_at INTEGER NOT NULL DEFAULT 0, UNIQUE(user_id,started_at,rounds_hash));
|
||||
CREATE TABLE IF NOT EXISTS session_rounds( session_id TEXT NOT NULL, round_index INTEGER NOT NULL, seconds INTEGER NOT NULL, PRIMARY KEY(session_id,round_index));
|
||||
CREATE TABLE IF NOT EXISTS meditation_logs( id TEXT PRIMARY KEY, user_id TEXT NOT NULL, session_id TEXT NOT NULL, duration_seconds INTEGER NOT NULL, completed_at INTEGER NOT NULL, updated_at INTEGER NOT NULL DEFAULT 0);
|
||||
CREATE TABLE IF NOT EXISTS habits( id TEXT PRIMARY KEY, user_id TEXT NOT NULL, name TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', color_r INTEGER NOT NULL, color_g INTEGER NOT NULL, color_b INTEGER NOT NULL, sync_mode INTEGER NOT NULL, sync_activity INTEGER NOT NULL, counter_enabled INTEGER NOT NULL DEFAULT 0, sort_order INTEGER NOT NULL, deleted_at INTEGER NOT NULL DEFAULT 0, updated_at INTEGER NOT NULL DEFAULT 0);
|
||||
CREATE TABLE IF NOT EXISTS habit_days( habit_id TEXT NOT NULL, local_date INTEGER NOT NULL, completed INTEGER NOT NULL, count INTEGER NOT NULL DEFAULT 0, session_count INTEGER NOT NULL DEFAULT 0, updated_at INTEGER NOT NULL, PRIMARY KEY(habit_id,local_date));
|
||||
CREATE TABLE IF NOT EXISTS imports( id TEXT PRIMARY KEY, imported_at INTEGER NOT NULL, format TEXT NOT NULL, source_name TEXT NOT NULL, session_count INTEGER NOT NULL, habit_count INTEGER NOT NULL);
|
||||
CREATE TABLE IF NOT EXISTS sync_outbox( seq INTEGER PRIMARY KEY AUTOINCREMENT, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, local_date INTEGER NOT NULL DEFAULT 0, queued_at INTEGER NOT NULL, UNIQUE(entity_type,entity_id,local_date));
|
||||
CREATE TABLE IF NOT EXISTS sync_ops( op_id TEXT PRIMARY KEY, client_id TEXT NOT NULL, seq INTEGER NOT NULL, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, local_date INTEGER NOT NULL DEFAULT 0, op_type TEXT NOT NULL, payload_json TEXT NOT NULL DEFAULT '', created_at INTEGER NOT NULL, sent_at INTEGER NOT NULL DEFAULT 0, acked_at INTEGER NOT NULL DEFAULT 0);
|
||||
INSERT OR IGNORE INTO meta(key,value) VALUES('schema_version','1');
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
#include "app_host.h"
|
||||
#include "current_app.h"
|
||||
#include "meditation_music.h"
|
||||
#include "meditation_session.h"
|
||||
#include "settings_audio.h"
|
||||
#include "src/platform/audio_runtime.h"
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Run the real app frames and routes, with a deterministic audio device. */
|
||||
typedef struct {
|
||||
bool playing;
|
||||
bool unloaded;
|
||||
int updates;
|
||||
int stops;
|
||||
float volume;
|
||||
} TestStream;
|
||||
|
||||
static TestStream streams[16];
|
||||
static int stream_count;
|
||||
static int bell_calls;
|
||||
static InnerBreeze app;
|
||||
|
||||
static TestStream *stream_for(NativeMusic music)
|
||||
{
|
||||
TestStream *stream = music.ctx_data;
|
||||
assert(stream != NULL && !stream->unloaded);
|
||||
return stream;
|
||||
}
|
||||
|
||||
void __wrap_InitAudioDevice(void) {}
|
||||
bool __wrap_IsAudioDeviceReady(void) { return false; }
|
||||
void __wrap_CloseAudioDevice(void) {}
|
||||
void __wrap_update_check_start(void) {}
|
||||
|
||||
void __wrap_app_play_bell_cue(InnerBreeze *state, float scale)
|
||||
{
|
||||
assert(state != NULL && scale > 0.0f);
|
||||
assert(audio_preview_music_loaded == 0);
|
||||
bell_calls++;
|
||||
}
|
||||
|
||||
NativeMusic __wrap_LoadMusicStream(const unsigned char *path)
|
||||
{
|
||||
assert(path != NULL && stream_count < 16);
|
||||
NativeMusic music = {0};
|
||||
music.frame_count = 48000;
|
||||
music.ctx_data = &streams[stream_count++];
|
||||
return music;
|
||||
}
|
||||
|
||||
bool __wrap_IsMusicValid(NativeMusic music)
|
||||
{
|
||||
return music.frame_count != 0 && music.ctx_data != NULL;
|
||||
}
|
||||
|
||||
void __wrap_PlayMusicStream(NativeMusic music)
|
||||
{
|
||||
stream_for(music)->playing = true;
|
||||
}
|
||||
|
||||
void __wrap_StopMusicStream(NativeMusic music)
|
||||
{
|
||||
TestStream *stream = stream_for(music);
|
||||
stream->playing = false;
|
||||
stream->stops++;
|
||||
}
|
||||
|
||||
void __wrap_UnloadMusicStream(NativeMusic music)
|
||||
{
|
||||
TestStream *stream = stream_for(music);
|
||||
stream->playing = false;
|
||||
stream->unloaded = true;
|
||||
}
|
||||
|
||||
void __wrap_PauseMusicStream(NativeMusic music)
|
||||
{
|
||||
stream_for(music)->playing = false;
|
||||
}
|
||||
|
||||
void __wrap_ResumeMusicStream(NativeMusic music)
|
||||
{
|
||||
stream_for(music)->playing = true;
|
||||
}
|
||||
|
||||
bool __wrap_IsMusicStreamPlaying(NativeMusic music)
|
||||
{
|
||||
return stream_for(music)->playing;
|
||||
}
|
||||
|
||||
void __wrap_UpdateMusicStream(NativeMusic music)
|
||||
{
|
||||
TestStream *stream = stream_for(music);
|
||||
if (stream->playing) {
|
||||
stream->updates++;
|
||||
}
|
||||
}
|
||||
|
||||
void __wrap_SetMusicVolume(NativeMusic music, float volume)
|
||||
{
|
||||
stream_for(music)->volume = volume;
|
||||
}
|
||||
|
||||
static void check_playing_frames(TestStream *stream)
|
||||
{
|
||||
int before = stream->updates;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
app_frame(&app);
|
||||
assert(stream->playing && !stream->unloaded && stream->stops == 0);
|
||||
assert(stream->updates == before + i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void settings_tab(int tab)
|
||||
{
|
||||
AppRoute route = app_current_route(&app);
|
||||
route.screen = ScreenSettings;
|
||||
route.settings_tab = tab;
|
||||
app_request_route(&app, route);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
assert(argc == 2 && getenv("APP_DATA_ROOT") != NULL);
|
||||
const char *display = getenv("DISPLAY");
|
||||
assert(display != NULL && display[0] == ':' && atoi(display + 1) >= 300);
|
||||
app_host_Prepare(1, (uint8_t **)argv);
|
||||
app_host_ConfigureWindow();
|
||||
raylib_host_InitWindow(900, 720, StringLiteral("Music navigation test"));
|
||||
assert(app_host_FinishWindowSetup() != 0);
|
||||
app_init(&app);
|
||||
SetCurrentApp(&app);
|
||||
app.tutorial_seen = 1;
|
||||
app.breaks_enabled = 0;
|
||||
app.audio_ready = 1;
|
||||
app.music_volume = 60;
|
||||
app.audio_custom_music_count = 1;
|
||||
snprintf((char *)app.audio_custom_music[0].path,
|
||||
sizeof(app.audio_custom_music[0].path), "%s", argv[1]);
|
||||
snprintf((char *)app.audio_custom_music[0].title,
|
||||
sizeof(app.audio_custom_music[0].title), "Navigation test track");
|
||||
int track = AUDIO_BUILTIN_MUSIC_COUNT;
|
||||
|
||||
settings_tab(SETTINGS_TAB_AUDIO);
|
||||
settings_audio_settings_audio_toggle_music_preview(&app, track);
|
||||
assert(stream_count == 1);
|
||||
TestStream *preview = &streams[0];
|
||||
check_playing_frames(preview);
|
||||
int tabs[] = {SETTINGS_TAB_THEME, SETTINGS_TAB_ABOUT, SETTINGS_TAB_DEVICE};
|
||||
for (size_t i = 0; i < sizeof(tabs) / sizeof(tabs[0]); i++) {
|
||||
settings_tab(tabs[i]);
|
||||
check_playing_frames(preview);
|
||||
}
|
||||
int routes[] = {AppNavRoute_APP_NAV_ROUTE_PRACTICE,
|
||||
AppNavRoute_APP_NAV_ROUTE_HABITS, AppNavRoute_APP_NAV_ROUTE_ELIST,
|
||||
AppNavRoute_APP_NAV_ROUTE_PROFILE, AppNavRoute_APP_NAV_ROUTE_SETTINGS};
|
||||
for (size_t i = 0; i < sizeof(routes) / sizeof(routes[0]); i++) {
|
||||
app_apply_nav_route(&app, routes[i]);
|
||||
check_playing_frames(preview);
|
||||
}
|
||||
app.music_volume = 35;
|
||||
check_playing_frames(preview);
|
||||
assert(preview->volume > 0.349f && preview->volume < 0.351f);
|
||||
settings_audio_settings_audio_toggle_music_preview(&app, track);
|
||||
assert(!preview->playing && !preview->unloaded);
|
||||
int paused_updates = preview->updates;
|
||||
app_frame(&app);
|
||||
assert(!preview->playing && preview->updates == paused_updates);
|
||||
settings_audio_settings_audio_toggle_music_preview(&app, track);
|
||||
check_playing_frames(preview);
|
||||
|
||||
/* Previewing in either panel replaces the other panel's stream. */
|
||||
app.exercise_type = ExerciseType_EXERCISE_MEDITATION;
|
||||
app.meditation.music_practice_tracks[app.exercise_type] = track;
|
||||
app.meditation.music_track = track;
|
||||
meditation_music_test_track(&app);
|
||||
TestStream *other_preview = &streams[stream_count - 1];
|
||||
assert(preview->unloaded && other_preview->playing);
|
||||
settings_audio_settings_audio_toggle_music_preview(&app, track);
|
||||
preview = &streams[stream_count - 1];
|
||||
assert(other_preview->unloaded && preview->playing);
|
||||
|
||||
/* Starting a practice clears its preview before ringing the opening bell. */
|
||||
meditation_session_meditation_start_seconds(&app, 60);
|
||||
assert(preview->unloaded && !preview->playing && bell_calls == 1);
|
||||
meditation_music_meditation_music_stop(&app);
|
||||
|
||||
/* Leaving Customize and visiting other tabs keeps practice previews alive. */
|
||||
app_open_main_tab(&app, AppMainTab_APP_MAIN_TAB_PRACTICE, 0);
|
||||
app.practice_tab = PRACTICE_TAB_CONFIG;
|
||||
app.meditation.music_track = track;
|
||||
meditation_music_test_track(&app);
|
||||
assert(app.meditation.music_test_playing != 0);
|
||||
TestStream *practice_preview = &streams[stream_count - 1];
|
||||
check_playing_frames(practice_preview);
|
||||
for (size_t i = 0; i < sizeof(routes) / sizeof(routes[0]); i++) {
|
||||
app_apply_nav_route(&app, routes[i]);
|
||||
check_playing_frames(practice_preview);
|
||||
}
|
||||
settings_tab(SETTINGS_TAB_AUDIO);
|
||||
meditation_music_meditation_music_fade_out(&app);
|
||||
check_playing_frames(practice_preview);
|
||||
assert(app.meditation.music_fade_out_ticks == 177);
|
||||
for (int i = 0; i < 177; i++) {
|
||||
meditation_music_update(&app);
|
||||
}
|
||||
assert(!practice_preview->playing && practice_preview->stops == 1);
|
||||
|
||||
/* A practice with music disabled clears a continuing preview too. */
|
||||
meditation_music_test_track(&app);
|
||||
TestStream *disabled_preview = &streams[stream_count - 1];
|
||||
assert(disabled_preview->playing);
|
||||
app.meditation.music_practice_tracks[app.exercise_type] = AUDIO_MUSIC_NONE;
|
||||
meditation_music_start_session(&app);
|
||||
assert(!disabled_preview->playing && disabled_preview->stops == 1);
|
||||
|
||||
settings_audio_settings_audio_toggle_music_preview(&app, track);
|
||||
TestStream *closing_preview = &streams[stream_count - 1];
|
||||
check_playing_frames(closing_preview);
|
||||
app_destroy(&app);
|
||||
assert(closing_preview->unloaded && !closing_preview->playing);
|
||||
SetCurrentApp(NULL);
|
||||
HostRaylibCloseWindow();
|
||||
app_host_Shutdown();
|
||||
puts("Music navigation: settings and app tabs, Customize, pause/resume, fade and shutdown passed");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
"""Exercise production app frames on a private display and temporary data root."""
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
ENV = dict(os.environ)
|
||||
for name in ("DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "GDK_DISPLAY"):
|
||||
ENV.pop(name, None)
|
||||
|
||||
WRAPPED_FUNCTIONS = (
|
||||
"InitAudioDevice", "IsAudioDeviceReady", "CloseAudioDevice",
|
||||
"LoadMusicStream", "IsMusicValid", "PlayMusicStream", "StopMusicStream",
|
||||
"UnloadMusicStream", "PauseMusicStream", "ResumeMusicStream",
|
||||
"IsMusicStreamPlaying", "UpdateMusicStream", "SetMusicVolume",
|
||||
"update_check_start", "app_play_bell_cue",
|
||||
)
|
||||
|
||||
objects = shlex.split((ROOT / "build/obj/native/objects.rsp").read_text())
|
||||
main_objects = [path for path in objects if path.endswith("/generated/src/main.o")]
|
||||
assert len(main_objects) == 1, "the native response file must have one app main"
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="music-navigation-", dir=ROOT / "build") as directory:
|
||||
work = Path(directory)
|
||||
response = work / "objects.rsp"
|
||||
response.write_text("\n".join(path for path in objects if path not in main_objects))
|
||||
binary = work / "test"
|
||||
command = shlex.split(sys.argv[1]) + shlex.split(sys.argv[2])
|
||||
command += ["-Wno-unused-function", "-Wno-unused-variable",
|
||||
str(ROOT / "tests/music_navigation_test.c"), "-o", str(binary),
|
||||
"@" + str(response)]
|
||||
command += ["-Wl,--wrap=" + name for name in WRAPPED_FUNCTIONS]
|
||||
command += shlex.split(sys.argv[3])
|
||||
subprocess.run(command, cwd=ROOT, env=ENV, check=True)
|
||||
|
||||
test_env = dict(ENV)
|
||||
test_env["APP_DATA_ROOT"] = str(work / "data")
|
||||
test_env["APP_NO_TRAY"] = "1"
|
||||
test_env["LIBGL_ALWAYS_SOFTWARE"] = "1"
|
||||
command = ["timeout", "30s", "xvfb-run", "-a", "-n", "300",
|
||||
"-s", "-screen 0 1280x900x24", str(binary),
|
||||
str(ROOT / "test-fixtures/audio/autumn-sunset.mp3")]
|
||||
result = subprocess.run(command, cwd=ROOT, env=test_env,
|
||||
capture_output=True, text=True)
|
||||
if result.returncode:
|
||||
print(result.stdout)
|
||||
print(result.stderr, file=sys.stderr)
|
||||
raise SystemExit(result.returncode)
|
||||
print(result.stdout.splitlines()[-1])
|
||||
+74
-1
@@ -3,6 +3,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
static sqlite3 *database;
|
||||
@@ -105,8 +106,80 @@ static void close_database(void)
|
||||
database = NULL;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
static void upgrade_1_8_9(const char *fixture)
|
||||
{
|
||||
FILE *file = fopen(fixture, "rb");
|
||||
assert(file != NULL);
|
||||
assert(fseek(file, 0, SEEK_END) == 0);
|
||||
long length = ftell(file);
|
||||
assert(length > 0);
|
||||
rewind(file);
|
||||
char *sql = malloc((size_t)length + 1);
|
||||
assert(sql != NULL);
|
||||
assert(fread(sql, 1, (size_t)length, file) == (size_t)length);
|
||||
sql[length] = '\0';
|
||||
assert(fclose(file) == 0);
|
||||
|
||||
open_memory_database();
|
||||
assert(exec_sql((uint8_t *)sql));
|
||||
free(sql);
|
||||
assert(exec_sql((uint8_t *)
|
||||
"INSERT INTO users VALUES('upgrade-user',123,'local');"
|
||||
"INSERT INTO settings VALUES('upgrade-user','style_index','3',124);"
|
||||
"INSERT INTO settings VALUES('upgrade-user','language','es',124);"
|
||||
"INSERT INTO habits VALUES('habit','upgrade-user','Practice','Keep me',"
|
||||
"10,20,30,0,0,1,0,0,125);"
|
||||
"INSERT INTO habit_days VALUES('habit',20261001,1,7,2,126);"
|
||||
"INSERT INTO sessions VALUES('session','upgrade-user',127,20261001,"
|
||||
"0,0,'local',127,12345,0,128);"
|
||||
"INSERT INTO session_rounds VALUES('session',0,60);"
|
||||
"INSERT INTO meditation_logs VALUES('meditation','upgrade-user',"
|
||||
"'session',60,129,130);"
|
||||
"INSERT INTO social_snapshots VALUES('upgrade-user','friends','{}',131);"
|
||||
"INSERT INTO imports VALUES('import',132,'csv','fixture',1,1);"
|
||||
"INSERT INTO sync_outbox(entity_type,entity_id,local_date,queued_at) "
|
||||
"VALUES('habit','habit',0,133);"
|
||||
"INSERT INTO sync_ops VALUES('pending-op','client',1,'habit','habit',"
|
||||
"0,'upsert','{\"name\":\"Practice\"}',134,0,0);"));
|
||||
|
||||
/* Opening the upgraded database repeatedly must retain all existing
|
||||
* rows, identity, preferences and pending synchronization work. */
|
||||
for(int launch = 0; launch < 2; launch++) {
|
||||
assert(schema_create());
|
||||
assert(migrate_schema());
|
||||
assert(load_or_create_user());
|
||||
assert(strcmp(current_user_id, "upgrade-user") == 0);
|
||||
assert(scalar("SELECT COUNT(*) FROM users") == 1);
|
||||
assert(scalar("SELECT COUNT(*) FROM settings WHERE "
|
||||
"key='style_index' AND value='3'") == 1);
|
||||
assert(scalar("SELECT COUNT(*) FROM settings WHERE "
|
||||
"key='language' AND value='es'") == 1);
|
||||
assert(scalar("SELECT COUNT(*) FROM habits WHERE id='habit' AND "
|
||||
"description='Keep me' AND counter_enabled=1 AND "
|
||||
"counter_target=1 AND weekdays=0 AND reminder_hour=-1 "
|
||||
"AND updated_at=125") == 1);
|
||||
assert(scalar("SELECT count FROM habit_days") == 7);
|
||||
assert(scalar("SELECT session_count FROM habit_days") == 2);
|
||||
assert(scalar("SELECT COUNT(*) FROM sessions WHERE id='session' AND "
|
||||
"updated_at=128 AND mood_before=0 AND mood_after=0 "
|
||||
"AND rounds_hash=12345") == 1);
|
||||
assert(scalar("SELECT seconds FROM session_rounds") == 60);
|
||||
assert(scalar("SELECT duration_seconds FROM meditation_logs") == 60);
|
||||
assert(scalar("SELECT COUNT(*) FROM social_snapshots") == 1);
|
||||
assert(scalar("SELECT COUNT(*) FROM imports") == 1);
|
||||
assert(scalar("SELECT COUNT(*) FROM sync_outbox") == 1);
|
||||
assert(scalar("SELECT queued_at FROM sync_outbox") == 133);
|
||||
assert(scalar("SELECT COUNT(*) FROM sync_ops WHERE "
|
||||
"op_id='pending-op' AND acked_at=0 AND "
|
||||
"payload_json='{\"name\":\"Practice\"}'") == 1);
|
||||
}
|
||||
close_database();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
assert(argc == 2);
|
||||
upgrade_1_8_9(argv[1]);
|
||||
open_memory_database();
|
||||
assert(schema_create());
|
||||
assert(!has_table("sync_outbox"));
|
||||
|
||||
@@ -29,4 +29,5 @@ mkdir -p "$work/generated"
|
||||
"$work/generated/sqlite.c" \
|
||||
"$root/vendor-builds/sqlite/sqlite3.c" -ldl -lpthread -lm \
|
||||
-o "$work/test"
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test"
|
||||
env -u DISPLAY -u WAYLAND_DISPLAY "$work/test" \
|
||||
"$root/tests/fixtures/schema-1.8.9.sql"
|
||||
@@ -1,10 +1,24 @@
|
||||
#import, file "../src/app/app_style.zi";
|
||||
#import, file "../src/app/app_types.zi";
|
||||
#import, file "../src/app/metrics.zi";
|
||||
#import, file "../src/app/theme_catalog.zi";
|
||||
#import "drawing_props"
|
||||
#import "style_sheet"
|
||||
#import "style"
|
||||
|
||||
#program_export
|
||||
StartupStyleCheck :: () -> s32 {
|
||||
for theme: 0..ThemeCount - 1 {
|
||||
for style: 1..3 {
|
||||
if !StyleInstall(cast(s32)theme, false, cast(s32)style) ||
|
||||
!StyleInstall(cast(s32)theme, true, cast(s32)style) {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return 42
|
||||
}
|
||||
|
||||
#program_export
|
||||
Answer :: () -> s32 {
|
||||
app: InnerBreeze
|
||||
@@ -21,7 +35,7 @@ Answer :: () -> s32 {
|
||||
if face.background != cast(u32)0xE2EEFCFF { return 3 }
|
||||
canvas := StyleTokenColor("canvas")
|
||||
if canvas.r != 0xE2 || canvas.g != 0xEE ||
|
||||
canvas.b != 0xFC || canvas.a != 0xFF { return 8 }
|
||||
canvas.b != 0xFC || canvas.a != 0xFF { return 8 }
|
||||
image_face := ResolveStyleRules(rules, base,
|
||||
StyleDefaultFacts(StyleKindImage()), 1)
|
||||
if image_face.background != cast(u32)0 { return 7 }
|
||||
@@ -34,19 +48,19 @@ Answer :: () -> s32 {
|
||||
if face.background != cast(u32)0x182838FF { return 5 }
|
||||
canvas = StyleTokenColor("canvas")
|
||||
if canvas.r != 0x18 || canvas.g != 0x28 ||
|
||||
canvas.b != 0x38 || canvas.a != 0xFF { return 9 }
|
||||
canvas.b != 0x38 || canvas.a != 0xFF { return 9 }
|
||||
|
||||
app.style_index = 3
|
||||
app.dark_mode = 0
|
||||
if !app_apply_style(*app) || style_pack_has_glow(3) != 1 ||
|
||||
style_pack_id(3) != "lightfield" { return 6 }
|
||||
style_pack_id(3) != "lightfield" { return 6 }
|
||||
|
||||
// Unchanged inputs keep the installed style; changed ones replace it.
|
||||
app.style_index = 1
|
||||
if !app_apply_style(*app) || !app_apply_style(*app) { return 10 }
|
||||
canvas = StyleTokenColor("canvas")
|
||||
if canvas.r != 0xE2 || canvas.g != 0xEE ||
|
||||
canvas.b != 0xFC || canvas.a != 0xFF { return 11 }
|
||||
canvas.b != 0xFC || canvas.a != 0xFF { return 11 }
|
||||
if ActiveStyleRules().count < 20 { return 12 }
|
||||
return 42
|
||||
}
|
||||
@@ -1,10 +1,30 @@
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
#include "style_apply_link_behavior.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <pthread.h>
|
||||
|
||||
static void *
|
||||
startup(void *argument)
|
||||
{
|
||||
(void)argument;
|
||||
assert(StartupStyleCheck() == 42);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
pthread_attr_t attributes;
|
||||
pthread_t thread;
|
||||
|
||||
/* Android native threads have much smaller stacks than the host main
|
||||
* thread. Exercise the entire startup parser chain within that budget. */
|
||||
assert(pthread_attr_init(&attributes) == 0);
|
||||
assert(pthread_attr_setstacksize(&attributes, 1024 * 1024) == 0);
|
||||
assert(pthread_create(&thread, &attributes, startup, NULL) == 0);
|
||||
assert(pthread_join(thread, NULL) == 0);
|
||||
assert(pthread_attr_destroy(&attributes) == 0);
|
||||
assert(Answer() == 42);
|
||||
return 0;
|
||||
}
|
||||
@@ -19,7 +19,7 @@ python3 "$root/scripts/embed-app-assets.py" "$work/assets.c" \
|
||||
"$root/build/packages/kss/styles/classic.kss" \
|
||||
"$root/build/packages/kss/styles/lightfield.kss" \
|
||||
"$root/assets/styles/inbe.kss"
|
||||
"${CC:-cc}" -std=c11 -DZIRAN_BOUNDS_CHECK -ffunction-sections \
|
||||
"${CC:-cc}" -std=c11 -Os -pthread -DZIRAN_BOUNDS_CHECK -ffunction-sections \
|
||||
-fdata-sections -Wl,--gc-sections \
|
||||
-I"$root/build/packages/ziran/include" -I"$work/c" -I"$root/src/app" \
|
||||
"$root/tests/style_apply_link_test.c" \
|
||||
|
||||
+4
-4
@@ -6,8 +6,8 @@ IDI_APP_ICON ICON "inbe.ico"
|
||||
IDI_NOTIFICATION_ICON ICON "inbe.ico"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,0,7,0
|
||||
PRODUCTVERSION 2,0,7,0
|
||||
FILEVERSION 2,0,8,0
|
||||
PRODUCTVERSION 2,0,8,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -24,11 +24,11 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "waozi"
|
||||
VALUE "FileDescription", "Inner Breeze"
|
||||
VALUE "FileVersion", "2.0.7"
|
||||
VALUE "FileVersion", "2.0.8"
|
||||
VALUE "InternalName", "inbe"
|
||||
VALUE "OriginalFilename", "inbe-windows-x86_64.exe"
|
||||
VALUE "ProductName", "Inner Breeze"
|
||||
VALUE "ProductVersion", "2.0.7"
|
||||
VALUE "ProductVersion", "2.0.8"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
+12
-12
@@ -55,12 +55,20 @@
|
||||
},
|
||||
{
|
||||
"commit": "396f1efedb702b1aacdd724a7b611302d95a0adc",
|
||||
"dependencies": {"kryon": "pdf546d242cd1c857"},
|
||||
"dependencies": {"kryon": "pa2bd4ff64fc0a419"},
|
||||
"id": "p7b9204ab0ad2089f",
|
||||
"name": "Game2D",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/game2d.git"
|
||||
},
|
||||
{
|
||||
"commit": "49f6cec21597784e927fe616e6b3b925ae04a5a9",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "pa2bd4ff64fc0a419",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "bb837dda23ed4df77a9bbeaefd69c8cd9b6e4915",
|
||||
"dependencies": {},
|
||||
@@ -79,17 +87,9 @@
|
||||
"source": true,
|
||||
"url": "https://github.com/LoupVaillant/Monocypher.git"
|
||||
},
|
||||
{
|
||||
"commit": "764fcc038d244dffead51c9e613c20820344f863",
|
||||
"dependencies": {"raylib": "p5a77c9c35110e925"},
|
||||
"id": "pdf546d242cd1c857",
|
||||
"name": "kryon",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/kryonlabs/kryon.git"
|
||||
},
|
||||
{
|
||||
"commit": "e1f07e615e9255a513dbb6d66e5e6e9d335ef690",
|
||||
"dependencies": {"kryon": "pdf546d242cd1c857"},
|
||||
"dependencies": {"kryon": "pa2bd4ff64fc0a419"},
|
||||
"id": "pfdf70946e0505dfe",
|
||||
"name": "Kss",
|
||||
"ref": "master",
|
||||
@@ -97,11 +97,11 @@
|
||||
}
|
||||
],
|
||||
"root": {
|
||||
"dependencies": {"curl": "pc4b263336680098b", "daochi_client": "p5a3be391420a26d3", "game2d": "p7b9204ab0ad2089f", "kryon": "pdf546d242cd1c857", "kss": "pfdf70946e0505dfe", "liboqs": "p051fa9c56d0358ad", "monocypher": "pccdfe79ccaafde45", "oqs": "p1b5dd8d89e3ab867", "rini": "p09fa77e94b0dfc6c", "sqlite": "p151b83a361c86f2d"},
|
||||
"dependencies": {"curl": "pc4b263336680098b", "daochi_client": "p5a3be391420a26d3", "game2d": "p7b9204ab0ad2089f", "kryon": "pa2bd4ff64fc0a419", "kss": "pfdf70946e0505dfe", "liboqs": "p051fa9c56d0358ad", "monocypher": "pccdfe79ccaafde45", "oqs": "p1b5dd8d89e3ab867", "rini": "p09fa77e94b0dfc6c", "sqlite": "p151b83a361c86f2d"},
|
||||
"name": "Inbe"
|
||||
},
|
||||
"toolchain": {
|
||||
"commit": "aa6b05d949fa10d6ef90a4b015c1f757b0029da1",
|
||||
"commit": "791eda8db3c08a194066f78b5f76818c1a46cec4",
|
||||
"ref": "master",
|
||||
"url": "https://github.com/ziranlang/ziran.git"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user