idf.py: Fix subcommand options

This commit is contained in:
Sergei Silnov 2019-06-27 20:23:14 +02:00
parent 265d7dc4e5
commit 56db269fb5
2 changed files with 10 additions and 1 deletions

View file

@ -488,6 +488,14 @@ endmenu\n" >> ${IDF_PATH}/Kconfig;
print_status "Can set -D twice: globally and for subcommand, only if values are the same"
idf.py -DAAA=BBB -DCCC=EEE build -DAAA=BBB -DCCC=EEE || failure "It should be allowed to set -D twice (globally and for subcommand) if values are the same"
# idf.py subcommand options, (using monitor with as example)
print_status "Can set options to subcommands: print_filter for monitor"
mv ${IDF_PATH}/tools/idf_monitor.py ${IDF_PATH}/tools/idf_monitor.py.tmp
echo "import sys;print(sys.argv[1:])" > ${IDF_PATH}/tools/idf_monitor.py
idf.py build || "Failed to build project"
idf.py monitor --print-filter="*:I" -p tty.fake | grep "'--print_filter', '\*:I'" || failure "It should process options for subcommands (and pass print-filter to idf_monitor.py)"
mv ${IDF_PATH}/tools/idf_monitor.py.tmp ${IDF_PATH}/tools/idf_monitor.py
print_status "Fail on build time works"
clean_build_dir
cp CMakeLists.txt CMakeLists.txt.bak
@ -499,6 +507,7 @@ endmenu\n" >> ${IDF_PATH}/Kconfig;
mv CMakeLists.txt.bak CMakeLists.txt
rm -rf CMakeLists.txt.bak
print_status "All tests completed"
if [ -n "${FAILURES}" ]; then
echo "Some failures were detected:"

View file

@ -876,7 +876,7 @@ def init_cli():
)
else:
print("Executing action: %s" % name_with_aliases)
task.run(ctx, global_args, **task.action_args)
task.run(ctx, global_args, task.action_args)
completed_tasks.add(task.name)