@@ -249,6 +249,52 @@ public function testCleanedUpLinkerError()
249
249
$ this ->assertEquals ($ expectedLinkerError , $ response ['message ' ]);
250
250
}
251
251
252
+ public function testEthernetCompileErrorRemovedLibraryPaths ()
253
+ {
254
+ $ files = array (array ("filename " => "Blink.ino " , "content " => "#include <Ethernet.h> \nvoid setup() { \n} \nvoid loop() { \n} \n" ));
255
+ $ format = "binary " ;
256
+ $ version = "105 " ;
257
+ $ libraries = array ('PseudoEthernet ' => array ('files ' => array ('filename ' => 'Ethernet.h ' , 'content ' => "#include \"SPI.h \"\n" )));
258
+ $ build = array ("mcu " => "atmega328p " , "f_cpu " => "16000000 " , "core " => "arduino " , "variant " => "standard " );
259
+
260
+ $ data = json_encode (array ("files " => $ files , "format " => $ format , "version " => $ version , "libraries " => $ libraries , "build " => $ build ));
261
+
262
+ $ client = static ::createClient ();
263
+
264
+ $ authorizationKey = $ client ->getContainer ()->getParameter ("authorizationKey " );
265
+
266
+ $ client ->request ('POST ' , '/ ' . $ authorizationKey . '/v1 ' , array (), array (), array (), $ data );
267
+
268
+ $ response = json_decode ($ client ->getResponse ()->getContent (), true );
269
+
270
+ $ this ->assertEquals ($ response ["success " ], false );
271
+ $ this ->assertEquals ($ response ["step " ], 4 );
272
+ $ this ->assertContains ('(library file) PseudoEthernet/Ethernet.h:1:10: </b><b><font style="color: red">fatal error: </font></b><b> \'SPI.h \' file not found ' , $ response ['message ' ]);
273
+ }
274
+
275
+ public function testEthernetCompileErrorRemovedPersonalLibraryPaths ()
276
+ {
277
+ $ files = array (array ("filename " => "Blink.ino " , "content " => "#include <Ethernet.h> \nvoid setup() { \n} \nvoid loop() { \n} \n" ));
278
+ $ format = "binary " ;
279
+ $ version = "105 " ;
280
+ $ libraries = array ('4096_cb_personal_lib_PseudoEthernet ' => array ('files ' => array ('filename ' => 'Ethernet.h ' , 'content ' => "#include \"SPI.h \"\n" )));
281
+ $ build = array ("mcu " => "atmega328p " , "f_cpu " => "16000000 " , "core " => "arduino " , "variant " => "standard " );
282
+
283
+ $ data = json_encode (array ("files " => $ files , "format " => $ format , "version " => $ version , "libraries " => $ libraries , "build " => $ build ));
284
+
285
+ $ client = static ::createClient ();
286
+
287
+ $ authorizationKey = $ client ->getContainer ()->getParameter ("authorizationKey " );
288
+
289
+ $ client ->request ('POST ' , '/ ' . $ authorizationKey . '/v1 ' , array (), array (), array (), $ data );
290
+
291
+ $ response = json_decode ($ client ->getResponse ()->getContent (), true );
292
+
293
+ $ this ->assertEquals ($ response ["success " ], false );
294
+ $ this ->assertEquals ($ response ["step " ], 4 );
295
+ $ this ->assertContains ('(personal library file) PseudoEthernet/Ethernet.h:1:10: </b><b><font style="color: red">fatal error: </font></b><b> \'SPI.h \' file not found ' , $ response ['message ' ]);
296
+ }
297
+
252
298
public function testAutocomplete ()
253
299
{
254
300
$ this ->markTestIncomplete ('No tests for the code completion feature yet. ' );
0 commit comments