@@ -184,60 +184,36 @@ def test_compile_blacklisted_sketchname(run_command, data_dir):
184
184
def test_compile_without_precompiled_libraries (run_command , data_dir ):
185
185
# Init the environment explicitly
186
186
url = "https://adafruit.github.io/arduino-board-index/package_adafruit_index.json"
187
- result = run_command ("core update-index --additional-urls={}" .format (url ))
188
- assert result .ok
189
- result = run_command (
"core install arduino:[email protected] --additional-urls={}" .
format (
url ))
190
- assert result .ok
191
- result = run_command (
"core install arduino:[email protected] --additional-urls={}" .
format (
url ))
192
- assert result .ok
193
- result = run_command (
"core install adafruit:[email protected] --additional-urls={}" .
format (
url ))
194
- 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 } " )
195
189
196
190
# Precompiled version of Arduino_TensorflowLite
197
- result = run_command (
"lib install [email protected] " )
198
- assert result .ok
199
- result = run_command (
200
- "compile -b arduino:mbed:nano33ble {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (data_dir )
201
- )
202
- assert result .ok
191
+ assert run_command ("lib install Arduino_LSM9DS1" )
192
+ assert run_command (
"lib install [email protected] " )
193
+
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 } " )
203
199
# should work on adafruit too after https://github.com/arduino/arduino-cli/pull/1134
204
- result = run_command (
205
- "compile -b adafruit:samd:adafruit_feather_m4 {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (
206
- data_dir
207
- )
208
- )
209
- assert result .ok
200
+ assert run_command (f"compile -b adafruit:samd:adafruit_feather_m4 { sketch_path } " )
210
201
211
202
# Non-precompiled version of Arduino_TensorflowLite
212
- result = run_command (
"lib install [email protected] " )
213
- assert result .ok
214
- result = run_command (
215
- "compile -b arduino:mbed:nano33ble {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (data_dir )
216
- )
217
- assert result .ok
218
- result = run_command (
219
- "compile -b adafruit:samd:adafruit_feather_m4 {}/libraries/Arduino_TensorFlowLite/examples/magic_wand/" .format (
220
- data_dir
221
- )
222
- )
223
- 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 } " )
224
206
225
207
# Bosch sensor library
226
- result = run_command (
'lib install "BSEC Software [email protected] "' )
227
- assert result .ok
228
- result = run_command (
229
- "compile -b arduino:samd:mkr1000 {}/libraries/BSEC_Software_Library/examples/basic/" .format (data_dir )
230
- )
231
- assert result .ok
232
- result = run_command (
233
- "compile -b arduino:mbed:nano33ble {}/libraries/BSEC_Software_Library/examples/basic/" .format (data_dir )
234
- )
235
- 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 } " )
236
212
237
213
# USBBlaster library
238
- result = run_command (
'lib install "[email protected] "' )
239
- assert result . ok
240
- result = run_command (f"compile -b arduino:samd:mkrvidor4000 { data_dir } /libraries/USBBlaster/examples/USB_Blaster/ " )
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 } " )
241
217
242
218
243
219
def test_compile_with_build_properties_flag (run_command , data_dir , copy_sketch ):
0 commit comments