Closed jori-nordic closed 3 weeks ago
hej @jori-nordic, I am new to zephyr and would like to work on this issue. can you please guide me and give me some information/references for my understanding.
Hi, yes. You should familiarize yourself with BabbleSim and read this page carefully first: https://docs.zephyrproject.org/latest/develop/test/bsim.html
Then also read all the files in the sample test's directory.
Then look at how we add arguments to the tests: We register a parsing function that will set some global variables. The arguments are passed on the command-line this way
The idea is to then:
CONFIG_APP_LOG_LEVEL
with LOG_LEVEL_DBG
on this lineLOG_LEVEL_INF
if the argument is not specified on the cli. This is an example of how to set the log level at runtime.The command line for setting e.g., LOG_LEVEL_DBG
would look something like this then, for the sample test:
Execute "${test_exe}" -v=${verbosity_level} -s=${simulation_id} -d=0 -rs=420 -testid=dut -argstest log_level 4
.
Here are the log level defines.
Happy hacking 💻
Created from https://github.com/zephyrproject-rtos/zephyr/pull/75154#discussion_r1658529168
A starting point would be implementing that for the sample bsim test. This way that pattern or library will automatically spread when people make new tests based on this sample.
https://github.com/zephyrproject-rtos/zephyr/blob/v3.7.0-rc2/tests/bsim/bluetooth/host/misc/sample_test/README.rst