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