@@ -292,18 +292,21 @@ def test_compile_with_esp8266_bundled_libraries(run_command, data_dir, copy_sket
292292 assert "\n " .join (expected_output ) not in res .stdout
293293
294294
295- def test_generate_compile_commands_json_with_esp32 (run_command , data_dir , copy_sketch ):
296- # https://github.com/arduino/arduino-cli/issues/1547
295+ def test_generate_compile_commands_json_resilience (run_command , data_dir , copy_sketch ):
297296 assert run_command (["update" ])
298297
299- # Update index with esp32 core and install it
298+ # check it didn't fail with esp32@2.0.1 that has a prebuild hook that must run:
299+ # https://github.com/arduino/arduino-cli/issues/1547
300300 url = "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
301301 assert run_command (["core" , "update-index" , f"--additional-urls={ url } " ])
302302 assert run_command (["core" , "install" , "esp32:esp32@2.0.1" , f"--additional-urls={ url } " ])
303-
304303 sketch_path = copy_sketch ("sketch_simple" )
305304 assert run_command (["compile" , "-b" , "esp32:esp32:featheresp32" , "--only-compilation-database" , sketch_path ])
306305
306+ # check it didn't fail on a sketch with a missing include
307+ sketch_path = copy_sketch ("sketch_with_missing_include" )
308+ assert run_command (["compile" , "-b" , "esp32:esp32:featheresp32" , "--only-compilation-database" , sketch_path ])
309+
307310
308311def test_compile_sketch_with_tpp_file_include (run_command , copy_sketch ):
309312 assert run_command (["update" ])
0 commit comments