Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra-args to twister don't make it to the cmake cache of on-target builds #84099

Open
solsbarry opened this issue Jan 16, 2025 · 0 comments
Open
Assignees
Labels
area: Twister Twister bug The issue is a bug, or the PR is fixing a bug

Comments

@solsbarry
Copy link
Contributor

Describe the bug

I am writing unit tests to run on hardware, using twister. I have a need to pass extra arguments (using -x, --extra-args) to cmake at the command line when I invoke twister. The output folder twister generates seems to have two different cmake areas, one for the overall invocation of twister, and then a subfolder for each test. However the extra arguments are only defined in the CMakeCache.txt file for the overall test folder, and they are not defined in the test specific CMakeCache.txt file (in the subfolder). And so my cmakelist.txt file which depends on these variables being available does not work right.

To Reproduce

  1. Generate a unit test that runs on a hardware platform.
  2. Add something in the cmakelist.txt file for that test that uses a variable that should come from the cmake cache (not otherwise defined). Which if its not defined causes the build to fail.
  3. invoke the test with twister defining your above variable with -x=MY_VARIABLE=VALUE
  4. See that the build fails, and that the variable is only defined in the overall twister cmake cache, and not in the test specific one.

Expected behavior

I would expect the variable to be defined in the tests cmake cache file.

Impact

I can't use twister, and will probably end up creating my own test orchestration framework.

Logs and console output

Environment (please complete the following information):

  • OS: Windows
  • Toolchain: 0.16.8
  • v3.7.99-ncs2 (I know this is a Nordic version, but I don't think there are any twister specific changes in it)

Additional context

The same thing happens if I specify the extra-args in the testcase.yaml file.

@solsbarry solsbarry added the bug The issue is a bug, or the PR is fixing a bug label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Twister Twister bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

3 participants