Questions on ztest : 1) Can twister/ztests run on windows? 2) Project structure #35516
Replies: 4 comments
-
I ran into the same question
The documentation here doesn't make it very clear (for a beginner like me) https://docs.zephyrproject.org/latest/guides/test/twister.html For me I tried to follow the instructions and run |
Beta Was this translation helpful? Give feedback.
-
Usually .cmd is the windows variant for scripts, but looking at But now that you mentioned it I see how Also I went through the setup for WSL Ubuntu 20.04 and everything works, am able to start tests within My only question now is how tests should be run/structured for out-of-tree/"freestanding" projects as illustrated in https://docs.zephyrproject.org/latest/guides/zephyr_cmake_package.html#zephyr-freestanding-application. |
Beta Was this translation helpful? Give feedback.
-
yes, this is possible. |
Beta Was this translation helpful? Give feedback.
-
twister can run on windows, but it can't execute tests in emulation. |
Beta Was this translation helpful? Give feedback.
-
Can twister/ztests run on windows?
I installed the requirements for twister in a virtualenv on Windows but when I try to run it, I get:
So I tried to see how to install
termios
and it seems this is a unix only package. So how does one run ztests on Windows? If it's not possible the docs don't seem to mention this (only tangentially withplatform_allow: native_posix
).If that's the case then the docs https://docs.zephyrproject.org/latest/guides/test/ztest.html#quick-start-integration-testing should probably be updated to say ztests cannot run on Windows (and perhaps suggest running them in WSL--which is what I'm trying at the moment).
Ztest project structure
Separate question for ztests:
Does twister support running ztests for projects NOT created through
west init
? I.e., out-of-tree projects.I ask because I understand how the tests in https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/subsys/testsuite/integration are run: each test directory contains
prj.conf
,testcase.yaml
,CMakeLists.txt
and the testsrc
directory.These tests can reference the subsystems they intend to test via e.g.,
#include <fs>
...... and since they all live within
ZEPHYR_BASE
, I presumetwister
does some magic with theZEPHYR_BASE
so it knows where the other libraries are defined.What about in the case of an out-of-tree project, as illustrated in https://docs.zephyrproject.org/latest/application/index.html#creating-an-application ?
I can't seem to wrap my head around how twister can run ztests in a real project as depicted in https://docs.zephyrproject.org/latest/guides/test/ztest.html#quick-start-integration-testing without modifying, say, project CMakeLists.txt.
For example with the following structure:
bar
references sources insrc/
, is this just supposed to work without additional configuration? How would twister know where the project sources are?twister
? Asking since I am actually using zephyr under PlatformIO, and it would be nice for everything to be managed by PlatformIO, which means zephyr, instead of using another tool.Beta Was this translation helpful? Give feedback.
All reactions