@@ -1303,3 +1303,44 @@ func TestCoreHavingIncompatibleDepTools(t *testing.T) {
1303
1303
require .Contains (t , lines , []string {"incompatible_vendor:avr" , "n/a" , "Incompatible" , "Boards" })
1304
1304
}
1305
1305
}
1306
+
1307
+ func TestReferencedCoreBuildAndRuntimeProperties (t * testing.T ) {
1308
+ env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
1309
+ defer env .CleanUp ()
1310
+
1311
+ _ ,
_ ,
err := cli .
Run (
"core" ,
"install" ,
"arduino:[email protected] " )
1312
+ require .NoError (t , err )
1313
+
1314
+ testSketchbook , err := paths .New ("testdata" , "sketchbook_with_extended_platform" ).Abs ()
1315
+ require .NoError (t , err )
1316
+
1317
+ // Install custom platform
1318
+ err = testSketchbook .Join ("hardware" ).CopyDirTo (cli .SketchbookDir ().Join ("hardware" ))
1319
+ require .NoError (t , err )
1320
+
1321
+ // Determine some useful paths
1322
+ boardPlatformPath := cli .SketchbookDir ().Join ("hardware" , "test" , "avr" ).String ()
1323
+ corePlatformPath := cli .DataDir ().Join ("packages" , "arduino" , "hardware" , "avr" , "1.8.6" ).String ()
1324
+ corePath := cli .DataDir ().Join ("packages" , "arduino" , "hardware" , "avr" , "1.8.6" , "cores" , "arduino" ).String ()
1325
+
1326
+ // Check runtime variables are populated correctly
1327
+ {
1328
+ outJson , _ , err := cli .Run ("board" , "details" , "-b" , "test:avr:test" , "--show-properties" , "--json" )
1329
+ require .NoError (t , err )
1330
+ out := requirejson .Parse (t , outJson ).Query (".build_properties" )
1331
+ out .ArrayMustContain (`"build.board.platform.path=` + boardPlatformPath + `"` )
1332
+ out .ArrayMustContain (`"build.core.platform.path=` + corePlatformPath + `"` )
1333
+ out .ArrayMustContain (`"build.core.path=` + corePath + `"` )
1334
+ out .ArrayMustContain (`"runtime.platform.path=` + boardPlatformPath + `"` )
1335
+ }
1336
+ {
1337
+ outJson , _ , err := cli .Run ("board" , "details" , "-b" , "test:avr:test2" , "--show-properties" , "--json" )
1338
+ require .NoError (t , err )
1339
+ out := requirejson .Parse (t , outJson ).Query (".build_properties" )
1340
+ out .ArrayMustContain (`"build.board.platform.path=` + boardPlatformPath + `"` )
1341
+ out .ArrayMustContain (`"build.core.platform.path=` + corePlatformPath + `"` )
1342
+ out .ArrayMustContain (`"build.core.path=` + corePath + `"` )
1343
+ // https://github.com/arduino/arduino-cli/issues/2616
1344
+ out .ArrayMustContain (`"runtime.platform.path=` + corePlatformPath + `"` )
1345
+ }
1346
+ }
0 commit comments