tools/compile_and_test_for_board: assert resultdir is valid

Currently giving an absolute or outside of RIOT application breaks the
result directory evaluation which can lead to deleting the application.

Add an assertion to detect it.
This commit is contained in:
Gaëtan Harter 2019-05-13 15:43:07 +02:00
parent db3847f107
commit 16f07e571e
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -232,6 +232,10 @@ class RIOTApplication():
self.resultdir = os.path.join(resultdir, appdir)
self.logger = logging.getLogger('%s.%s' % (board, appdir))
# Currently not handling absolute directories or outside of RIOT
assert is_in_directory(self.resultdir, resultdir), \
"Application result directory is outside main result directory"
# Extract values from make
def name(self):
"""Get application name."""