Skip to content

Commit 54d1bb7

Browse files
theob-procarlescufi
authored andcommitted
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 <[email protected]>
1 parent 12ea90c commit 54d1bb7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/bsim/compile.source

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ function _compile(){
4242
local map_file_name=${exe_name}.Tsymbols
4343

4444
local this_dir=${WORK_DIR}/${app}/${exe_basename}
45+
local app_absolute=$(realpath "${app_root}/${app}")
46+
if [[ "${app_absolute}" != "${app_root}"* ]]; then
47+
this_dir=${WORK_DIR}/${app_absolute}/${exe_basename}
48+
fi
4549

4650
local modules_arg="${ZEPHYR_MODULES:+-DZEPHYR_MODULES=${ZEPHYR_MODULES}}"
4751

0 commit comments

Comments
 (0)