@@ -419,3 +419,28 @@ func TestCompileWithoutUploadAndFqbn(t *testing.T) {
419
419
require .Error (t , err )
420
420
require .Contains (t , string (stderr ), "Missing FQBN (Fully Qualified Board Name)" )
421
421
}
422
+
423
+ func TestCompileNonInstalledPlatformWithWrongPackagerAndArch (t * testing.T ) {
424
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
425
+ defer env .CleanUp ()
426
+
427
+ _ , _ , err := cli .Run ("update" )
428
+ require .NoError (t , err )
429
+
430
+ // Create a sketch
431
+ sketchPath := cli .SketchbookDir ().Join ("SketchSimple" )
432
+ _ , _ , err = cli .Run ("sketch" , "new" , sketchPath .String ())
433
+ require .NoError (t , err )
434
+
435
+ // Compile with wrong packager
436
+ _ , stderr , err := cli .Run ("compile" , "-b" , "wrong:avr:uno" , sketchPath .String ())
437
+ require .Error (t , err )
438
+ require .Contains (t , string (stderr ), "Error during build: Platform 'wrong:avr' not found: platform not installed" )
439
+ require .Contains (t , string (stderr ), "Platform wrong:avr is not found in any known index" )
440
+
441
+ // Compile with wrong arch
442
+ _ , stderr , err = cli .Run ("compile" , "-b" , "arduino:wrong:uno" , sketchPath .String ())
443
+ require .Error (t , err )
444
+ require .Contains (t , string (stderr ), "Error during build: Platform 'arduino:wrong' not found: platform not installed" )
445
+ require .Contains (t , string (stderr ), "Platform arduino:wrong is not found in any known index" )
446
+ }
0 commit comments