[Buildroot] [RFC PATCH 0/1] support/testing: add FLAT stack size test

Fengwei Tan <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <SY8P300MB004155B06C42E80A3B391B70F8A12@SY8P300MB0041.AUSP300.PROD.OUTLOOK.COM>
As we discussed in [1], this patch adds a simple test case to verify
that $(PKG)_FLAT_STACKSIZE works as expected.

I see two possible approaches to implementing this test:

1. Inspect the FLAT header to check if the stack size matches the value
   defined in the package's Makefile (the approach taken in this patch).
2. Run the built FLAT binary in QEMU and verify the stack size at
   runtime. This is more complex, but directly confirms runtime
   allocation.

I would appreciate your feedback on which approach is preferred.

I have also pushed this patch to GitLab CI, and the test job passed
successfully [2].

Best regards,
Fengwei Tan

[1] https://lore.kernel.org/buildroot/SY8P300MB0041233A165784A8729859B2F8A32@SY8P300MB0041.AUSP300.PROD.OUTLOOK.COM/
[2] https://gitlab.com/tfx2001/buildroot/-/jobs/16053520032

Fengwei Tan (1):
  support/testing: add FLAT stack size test

 DEVELOPERS                                    |  3 +++
 .../br2-external/flat-stacksize/Config.in     |  1 +
 .../br2-external/flat-stacksize/external.desc |  1 +
 .../br2-external/flat-stacksize/external.mk   |  1 +
 .../package/flat-stacksize-test/Config.in     |  7 +++++
 .../package/flat-stacksize-test/Makefile      | 15 +++++++++++
 .../flat-stacksize-test.mk                    | 22 +++++++++++++++
 .../package/flat-stacksize-test/main.c        |  3 +++
 .../testing/tests/core/test_flat_stacksize.py | 27 +++++++++++++++++++
 9 files changed, 80 insertions(+)
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/Config.in
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/external.desc
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/external.mk
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/package/flat-stacksize-test/Config.in
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/package/flat-stacksize-test/Makefile
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/package/flat-stacksize-test/flat-stacksize-test.mk
 create mode 100644 support/testing/tests/core/br2-external/flat-stacksize/package/flat-stacksize-test/main.c
 create mode 100644 support/testing/tests/core/test_flat_stacksize.py

-- 
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.