Skip to content

bootutil: mynewt: Fix boot_serial unit tests#2711

Open
sjanc wants to merge 1 commit intomcu-tools:mainfrom
sjanc:mynewt_unitest
Open

bootutil: mynewt: Fix boot_serial unit tests#2711
sjanc wants to merge 1 commit intomcu-tools:mainfrom
sjanc:mynewt_unitest

Conversation

@sjanc
Copy link
Copy Markdown
Contributor

@sjanc sjanc commented Apr 24, 2026

When in unittest we shall include all sources.

@sjanc sjanc requested a review from davidvincze as a code owner April 24, 2026 14:34
@sjanc
Copy link
Copy Markdown
Contributor Author

sjanc commented Apr 24, 2026

@m-gorecki FYI

@d3zd3z
Copy link
Copy Markdown
Member

d3zd3z commented Apr 27, 2026

For example, here is a more detailed commit text, feel free to use and/or adapt.

  bootutil: mynewt: Fix boot_serial unit tests

  Commit e0152095 ("bootutil: mynewt: Improve BOOTUTIL configuration")
  added a pkg.source_files.!BOOT_LOADER override so that applications
  depending on bootutil only build bootutil_public.c, avoiding the
  need to set bootloader-only syscfgs for plain application builds.

  This override also fires when the boot_serial test package
  (pkg.type: unittest) is built, since BOOT_LOADER is not defined in
  that case. The result is that the unittest binary is linked against
  only bootutil_public.c and fails to resolve the rest of the
  bootutil symbols it exercises.

  Restrict the override to non-SELFTEST builds so unit tests get the
  full bootutil source list while application builds remain
  unaffected.

  Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>

Commit e015209 ("bootutil: mynewt: Improve BOOTUTIL configuration")
added a pkg.source_files.!BOOT_LOADER override so that applications
depending on bootutil only build bootutil_public.c, avoiding the
need to set bootloader-only syscfgs for plain application builds.

This override also fires when the boot_serial test package
(pkg.type: unittest) is built, since BOOT_LOADER is not defined in
that case. The result is that the unittest binary is linked against
only bootutil_public.c and fails to resolve the rest of the
bootutil symbols it exercises.

Restrict the override to non-SELFTEST builds so unit tests get the
full bootutil source list while application builds remain
unaffected.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants