/una-sdk:una-unit-testfrom una-sdk
Writes and runs GoogleTest unit tests for UNA Watch app logic on the PC's own compiler using SDK kernel test doubles and an in-memory file system. Use when adding tests to a UNA Watch app, testing settings or file code without a watch or simulator, or setting up a Tests/ folder.
Ships in una-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Unit tests build the app's own classes with the PC's compiler (MSVC, GCC or Clang) against the
SDK's fake kernel. They need no ARM toolchain, simulator or watch, and run in seconds. Test
logic here, and use the simulator (skill una-simulator) for screens and the whole app.
Good candidates are plain classes in Software/Libs that take an SDK::Kernel& or nothing:
Service.cpp itself, sensor callbacks and GUI code depend on the running kernel, so test them
in the simulator instead. If the logic the user wants tested is tangled into Service.cpp,
suggest moving it into its own class first.
Tests/ in the appreferences/CMakeLists.txt from this skill to <app>/Tests/CMakeLists.txt.add_executable(app-tests ...), list:
Software/Libs/Sources (Software/Libs/Source
in glances; change the template's paths to match).Libs/Source/Fit/*.cpp for FIT
files), add them to that list too, from ${UNA_SDK}/Libs/Source/.... A linker error naming
an SDK symbol means one is missing.build-tests/ in git.From the app root, with UNA_SDK set:
cmake -S Tests -B build-tests -DCMAKE_BUILD_TYPE=Debug
cmake --build build-tests --config Debug
ctest --test-dir build-tests -C Debug --output-on-failure
-C Debug and --config Debug are
required there and harmless elsewhere.build-tests/Debug/app-tests --gtest_filter='Settings*' (build-tests/app-tests with
single-config generators).#include <gtest/gtest.h>
#include "KernelTestDoubles.hpp"
#include "SettingsSerializer.hpp" // app code
using SDK::TestSupport::KernelFixture;
TEST(Settings, LoadsSavedUnits)
{
KernelFixture fixture; // fixture.kernel is a ready SDK::Kernel
fixture.fileSystem.seedFile("settings.json", R"({"units":"imperial"})");
SettingsSerializer serializer(fixture.kernel, "settings.json");
Settings s{};
ASSERT_TRUE(serializer.load(s));
EXPECT_EQ(s.units, Units::Imperial);
}
KernelFixture holds:
system: StubSystem; set nowMs to move its clock;logger;memory;comm: StubAppComm;fileSystem: InMemoryFileSystem;kernel: built from all of the above.seedFile(path, content) creates a file and the directories along its
path. readFile(path) returns what the code wrote.dir(path) with readNext() lists direct children only, in creation order, not
name order. A listing is a snapshot taken at open()./ don't matter. . and .. are
plain names.failWritesAfterBytes makes writes fail once that many bytes have been written, across all
files;closeGate decides, per path, whether a close() fails;failWriteOpenSuffix makes opening a file with that suffix for writing fail;failRenames makes every rename fail.openHandles and flushCounts count per path, so a test can check
that the code closed and flushed its files.Docs/unit-testing.md in the SDK lists where the fake differs from the
watch's FAT file system.nowMs, or the
time a function takes). Don't depend on the PC's time zone.size_t, long and
pointer sizes differ. Use fixed-width types (uint32_t) in app code that is serialised or sent
in messages.UNA_SDK environment variable is not set: set it in this shell (skill una-setup).core_json.h not found: check that UNA_SDK points at the SDK root; the header is in
$UNA_SDK/ThirdParty/coreJSON/source/include.Libs/Source/UnaLogger/Logger.cpp in una_test_support.target_include_directories(app-tests ...).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/una-build-uappBuild a UNA Watch app's .uapp package for the watch with CMake and the arm-none-eabi toolchain, and set its version, ID and memory sizes. Use when building, rebuilding or versioning a UNA Watch app for the device, or when a .uapp build fails./una-new-appStart a new UNA Watch app (activity, utility, glance or clockface) by copying the closest SDK example and renaming it. Covers choosing between a TouchGFX and an LVGL GUI, a fresh APP_ID, the paths to fix when the app lives outside the SDK, regenerating TouchGFX code, and converting LVGL fonts and images. Use when creating a UNA Watch app or watch face, when deciding which GUI toolkit to use, or when regenerating TouchGFX code or adding fonts or images to an app./una-setupnpx claudepluginhub unawatch/una-sdk --plugin una-sdkOther plugins' skills for the same job