Tests: bsim: Use correct compilation folder
If a test was written outside 'app_root' the 'app' path may contain previous directory ('..') which would lead to the compilation file being written outside the 'WORK_DIR'. Fix the issue by checking if the 'app' is inside 'app_root', if it's not, use the absolute path to the app for creating the 'this_dir' variable. Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
This commit is contained in:
parent
12ea90c8dc
commit
54d1bb73dc
1 changed files with 4 additions and 0 deletions
|
@ -42,6 +42,10 @@ function _compile(){
|
||||||
local map_file_name=${exe_name}.Tsymbols
|
local map_file_name=${exe_name}.Tsymbols
|
||||||
|
|
||||||
local this_dir=${WORK_DIR}/${app}/${exe_basename}
|
local this_dir=${WORK_DIR}/${app}/${exe_basename}
|
||||||
|
local app_absolute=$(realpath "${app_root}/${app}")
|
||||||
|
if [[ "${app_absolute}" != "${app_root}"* ]]; then
|
||||||
|
this_dir=${WORK_DIR}/${app_absolute}/${exe_basename}
|
||||||
|
fi
|
||||||
|
|
||||||
local modules_arg="${ZEPHYR_MODULES:+-DZEPHYR_MODULES=${ZEPHYR_MODULES}}"
|
local modules_arg="${ZEPHYR_MODULES:+-DZEPHYR_MODULES=${ZEPHYR_MODULES}}"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue