Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions scripts/west_commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,21 +193,6 @@ def do_run(self, args, remainder):
# Store legacy -s option locally
source_dir = self.args.source_dir
self._parse_remainder(remainder)
board, origin = self._find_board()
# Parse testcase.yaml or sample.yaml files for additional options.
if self.args.test_item:
# we get path + testitem
item = os.path.basename(self.args.test_item)
if self.args.source_dir:
test_path = self.args.source_dir
else:
test_path = os.path.dirname(self.args.test_item)
if test_path and os.path.exists(test_path):
self.args.source_dir = test_path
if not self._parse_test_item(item, board):
self.die("No test metadata found")
else:
self.die("test item path does not exist")

if source_dir:
if self.args.source_dir:
Expand Down Expand Up @@ -264,6 +249,23 @@ def do_run(self, args, remainder):
except Exception as e:
self.wrn(f'Failed to create info file: {build_info_file},', e)

board, origin = self._find_board()

# Parse testcase.yaml or sample.yaml files for additional options.
if self.args.test_item:
# we get path + testitem
item = os.path.basename(self.args.test_item)
if self.args.source_dir:
test_path = self.args.source_dir
else:
test_path = os.path.dirname(self.args.test_item)
if test_path and os.path.exists(test_path):
self.args.source_dir = test_path
if not self._parse_test_item(item, board):
self.die("No test metadata found")
else:
self.die("test item path does not exist")

self._run_cmake(board, origin, self.args.cmake_opts)
if args.cmake_only:
return
Expand Down
Loading