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
14 changes: 11 additions & 3 deletions dist/tools/compile_test/compile_like_murdock.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,16 @@ def _modules_packages(app, board, jobs, env, cwd, args):
_print_module_or_pkg_mismatch(app, board, lines, args)


def _build(app, board, jobs, env, cwd, args):
def _build(app, board, toolchain, jobs, env, cwd, args):
cmd = (f'/bin/bash -c "source .murdock; JOBS={jobs} '
f'compile {app} {board}:gnu"')
f'compile {app} {board}:{toolchain}"')
try:
out = __exec_cmd(cmd, shell=True, env=env, cwd=cwd,
stderr=subprocess.STDOUT)
if args.very_very_verbose:
print(out)
print(f"{app: <30} {board: <30} PASS")
return True
except subprocess.CalledProcessError as err:
err.output = err.output.decode("utf-8", errors="replace")
lines = err.output.split("\n")
Expand All @@ -215,6 +216,7 @@ def _build(app, board, jobs, env, cwd, args):
print(f"{app: <30} {board: <30} FAIL: Kconfig hash mismatch")
else:
print(f"{app: <30} {board: <30} FAIL")
return False


def main():
Expand All @@ -235,6 +237,8 @@ def main():
parser.add_argument("-a", "--apps", nargs="+",
help=("A list of apps to test on the supported boards."
" If empty we will choose what is tested."))
parser.add_argument("-t", "--toolchain", choices=["gnu", "llvm"], default="gnu",
help=("Toolchain to use"))
parser.add_argument("-d", "--dry-run", action="store_true",
help=("Show each of the boards and apps to be compiled"
" without spending super long to compile them"))
Expand All @@ -261,6 +265,7 @@ def main():
if 'all' in apps:
apps = _all_apps(riot_dir)

ret = 0
for app in apps:
test_dir = str(pathlib.PurePath(riot_dir, app))
if not pathlib.Path(test_dir).exists():
Expand All @@ -281,9 +286,12 @@ def main():
_modules_packages(app, board, args.jobs, full_env, riot_dir,
args)
else:
_build(app, board, args.jobs, full_env, riot_dir, args)
if not _build(app, board, args.toolchain, args.jobs, full_env,
riot_dir, args):
ret = -1
elapse_time = datetime.datetime.now() - start_time
_end(elapse_time.total_seconds(), args.jobs)
exit(ret)


if __name__ == '__main__':
Expand Down
Loading