diff options
| author | cirakg <cirakg@cirakg.xyz> | 2026-10-18 21:10:37 +0200 |
|---|---|---|
| committer | cirakg <cirakg@cirakg.xyz> | 2026-10-18 21:10:37 +0200 |
| commit | 773df56883b9961b607a1994920f5ef5299423b8 (patch) | |
| tree | e813e8f975e3cfa7a992222e5bf63ef615469916 /test | |
| parent | 2292bf700d28ade39cf2d64b45509e6db21034bc (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'test')
| -rw-r--r-- | test/SmokeTest.mc | 41 |
1 files changed, 41 insertions, 0 deletions
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; +} |
