From 56db269fb59dd28bc492bd6a389878b32c27d4ea Mon Sep 17 00:00:00 2001 From: Sergei Silnov Date: Thu, 27 Jun 2019 20:23:14 +0200 Subject: [PATCH] idf.py: Fix subcommand options --- tools/ci/test_build_system_cmake.sh | 9 +++++++++ tools/idf.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index faac26defd..76fe12a16c 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -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:" diff --git a/tools/idf.py b/tools/idf.py index e0037c96d1..daa17f9594 100755 --- a/tools/idf.py +++ b/tools/idf.py @@ -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) -- 2.40.0