]> granicus.if.org Git - esp-idf/commitdiff
idf.py: Fix subcommand options
authorSergei Silnov <sergei.silnov@espressif.com>
Thu, 27 Jun 2019 18:23:14 +0000 (20:23 +0200)
committerSergei Silnov <sergei.silnov@espressif.com>
Fri, 28 Jun 2019 08:07:38 +0000 (10:07 +0200)
tools/ci/test_build_system_cmake.sh
tools/idf.py

index faac26defdef5cdf0b387987bfef2731bfe0080b..76fe12a16cd7797fe4b14f0742cc86cda5e96128 100755 (executable)
@@ -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:"
index e0037c96d15bdbec2950cbd0418f964b573b74ec..daa17f9594db6794992c6ecfce2db3fce034251a 100755 (executable)
@@ -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)