@@ -181,65 +181,39 @@ def test_compile_blacklisted_sketchname(run_command, data_dir):
181
181
assert result .ok
182
182
183
183
184
- @pytest .mark .skip ()
185
184
def test_compile_without_precompiled_libraries (run_command , data_dir ):
186
185
# Init the environment explicitly
187
186
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:[email protected] --additional-urls={}" .
format (
url ))
193
- assert result .ok
194
- result = run_command (
"core install arduino:[email protected] --additional-urls={}" .
format (
url ))
195
- assert result .ok
196
- result = run_command (
"core install adafruit:[email protected] --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:[email protected] --additional-urls={ url } " )
198
189
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 [email protected] " )
202
193
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 [email protected] " )
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:[email protected] --additional-urls={ url } " )
198
+ assert run_command (
f"core install adafruit:[email protected] --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 } " )
217
201
218
202
# Non-precompiled version of Arduino_TensorflowLite
219
- result = run_command (
"lib install [email protected] " )
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 [email protected] " )
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 } " )
231
206
232
207
# Bosch sensor library
233
- result = run_command (
'lib install "BSEC Software [email protected] "' )
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 [email protected] "' )
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 "[email protected] "' )
215
+ sketch_path = Path (data_dir , "libraries" , "USBBlaster" , "examples" , "USB_Blaster" )
216
+ assert run_command (f"compile -b arduino:samd:mkrvidor4000 { sketch_path } " )
243
217
244
218
245
219
def test_compile_with_build_properties_flag (run_command , data_dir , copy_sketch ):
0 commit comments