From 773df56883b9961b607a1994920f5ef5299423b8 Mon Sep 17 00:00:00 2001 From: cirakg Date: Sun, 18 Oct 2026 21:10:37 +0200 Subject: feat(app): add minimal watch app with smoke test and per-size icons The M0 placeholder app: AppBase entry point, home screen with name and version, debug-only diagnostics (start-up time, memory) and a unit test that runs in the headless simulator. Builds with strict type checking and zero warnings for all 72 products; icons.jungle gives every product a launcher icon of its exact size. Co-Authored-By: Claude Opus 5.5 --- test/SmokeTest.mc | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/SmokeTest.mc (limited to 'test/SmokeTest.mc') diff --git a/test/SmokeTest.mc b/test/SmokeTest.mc new file mode 100644 index 0000000..60e98c1 --- /dev/null +++ b/test/SmokeTest.mc @@ -0,0 +1,41 @@ +// Author: cirakg & claude ai +// Summary: Smoke test proving the unit-test pipeline works end to end. +// +// SmokeTest: proves the unit-test pipeline works end to end: compile with +// --unit-test, run in the headless simulator, parse the results with +// tools/ciq_test_report.py. The real test suites start with milestone M2. + +import Toybox.Lang; +import Toybox.Test; + +// ASCII codes of the characters a version may contain. +const ASCII_DOT = 46; +const ASCII_ZERO = 48; +const ASCII_NINE = 57; + +// AppInfo.VERSION must look like MAJOR.MINOR.PATCH: three non-empty runs of +// digits separated by two dots, nothing else. +(:test) +function smokeVersionIsSemver(logger as Test.Logger) as Boolean { + var dots = 0; + var digitsInPart = 0; + var chars = AppInfo.VERSION.toCharArray(); + for (var i = 0; i < chars.size(); i++) { + var code = chars[i].toNumber(); + if (code == ASCII_DOT) { + if (digitsInPart == 0) { + logger.error("empty part in version " + AppInfo.VERSION); + return false; + } + dots++; + digitsInPart = 0; + } else if (code >= ASCII_ZERO && code <= ASCII_NINE) { + digitsInPart++; + } else { + logger.error("unexpected character in version " + AppInfo.VERSION); + return false; + } + } + logger.debug("version " + AppInfo.VERSION); + return dots == 2 && digitsInPart > 0; +} -- cgit v1.2.3