@@ -181,65 +181,39 @@ def test_compile_blacklisted_sketchname(run_command, data_dir):
181181 assert result .ok
182182
183183
184- @pytest .mark .skip ()
185184def test_compile_without_precompiled_libraries (run_command , data_dir ):
186185 # Init the environment explicitly
187186 url = "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json"
188- result = run_command ("core update-index --additional-urls={}" .format (url ))
189- assert result .ok
190- # arduino:mbed 1.1.5 is incompatible with the Arduino_TensorFlowLite library
191- # see: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/93
192- result = run_command ("core install arduino:mbed@1.1.4 --additional-urls={}" .format (url ))
193- assert result .ok
194- result = run_command ("core install arduino:samd@1.8.7 --additional-urls={}" .format (url ))
195- assert result .ok
196- result = run_command ("core install adafruit:samd@1.6.0 --additional-urls={}" .format (url ))
197- assert result .ok
187+ assert run_command (f"core update-index --additional-urls={ url } " )
188+ assert run_command (f"core install arduino:mbed@1.3.1 --additional-urls={ url } " )
198189
199- # Install pre-release version of Arduino_TensorFlowLite (will be officially released
200- # via lib manager after https://github.com/arduino/arduino-builder/issues/353 is in )
201- import zipfile
190+ # Precompiled version of Arduino_TensorflowLite
191+ assert run_command ( " lib install Arduino_LSM9DS1" )
192+ assert run_command ( "lib install Arduino_TensorflowLite@2.1.1-ALPHA-precompiled" )
202193
203- with zipfile .ZipFile ("test/testdata/Arduino_TensorFlowLite.zip" , "r" ) as zip_ref :
204- zip_ref .extractall ("{}/libraries/" .format (data_dir ))
205- result = run_command ("lib install Arduino_LSM9DS1@1.1.0" )
206- assert result .ok
207- result = run_command (
208- "compile -b arduino:mbed:nano33ble {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (data_dir )
209- )
210- assert result .ok
211- result = run_command (
212- "compile -b adafruit:samd:adafruit_feather_m4 {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (
213- data_dir
214- )
215- )
216- assert result .ok
194+ sketch_path = Path (data_dir , "libraries" , "Arduino_TensorFlowLite" , "examples" , "hello_world" )
195+ assert run_command (f"compile -b arduino:mbed:nano33ble { sketch_path } " )
196+
197+ assert run_command (f"core install arduino:samd@1.8.7 --additional-urls={ url } " )
198+ assert run_command (f"core install adafruit:samd@1.6.4 --additional-urls={ url } " )
199+ # should work on adafruit too after https://github.com/arduino/arduino-cli/pull/1134
200+ assert run_command (f"compile -b adafruit:samd:adafruit_feather_m4 { sketch_path } " )
217201
218202 # Non-precompiled version of Arduino_TensorflowLite
219- result = run_command ("lib install Arduino_TensorflowLite@1.15.0-ALPHA" )
220- assert result .ok
221- result = run_command (
222- "compile -b arduino:mbed:nano33ble {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (data_dir )
223- )
224- assert result .ok
225- result = run_command (
226- "compile -b adafruit:samd:adafruit_feather_m4 {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (
227- data_dir
228- )
229- )
230- assert result .ok
203+ assert run_command ("lib install Arduino_TensorflowLite@2.1.0-ALPHA" )
204+ assert run_command (f"compile -b arduino:mbed:nano33ble { sketch_path } " )
205+ assert run_command (f"compile -b adafruit:samd:adafruit_feather_m4 { sketch_path } " )
231206
232207 # Bosch sensor library
233- result = run_command ('lib install "BSEC Software Library@1.5.1474"' )
234- assert result .ok
235- result = run_command (
236- "compile -b arduino:samd:mkr1000 {}/libraries/BSEC_Software_Library/examples/basic/" .format (data_dir )
237- )
238- assert result .ok
239- result = run_command (
240- "compile -b arduino:mbed:nano33ble {}/libraries/BSEC_Software_Library/examples/basic/" .format (data_dir )
241- )
242- assert result .ok
208+ assert run_command ('lib install "BSEC Software Library@1.5.1474"' )
209+ sketch_path = Path (data_dir , "libraries" , "BSEC_Software_Library" , "examples" , "basic" )
210+ assert run_command (f"compile -b arduino:samd:mkr1000 { sketch_path } " )
211+ assert run_command (f"compile -b arduino:mbed:nano33ble { sketch_path } " )
212+
213+ # USBBlaster library
214+ assert run_command ('lib install "USBBlaster@1.0.0"' )
215+ sketch_path = Path (data_dir , "libraries" , "USBBlaster" , "examples" , "USB_Blaster" )
216+ assert run_command (f"compile -b arduino:samd:mkrvidor4000 { sketch_path } " )
243217
244218
245219def test_compile_with_build_properties_flag (run_command , data_dir , copy_sketch ):
0 commit comments