@@ -19,7 +19,6 @@ import (
1919 "encoding/json"
2020 "fmt"
2121 "os"
22- "path/filepath"
2322 "runtime"
2423 "sort"
2524 "strconv"
@@ -52,12 +51,16 @@ func TestCorrectHandlingOfPlatformVersionProperty(t *testing.T) {
5251 "platforms": [
5352 {
5453 "id":"DxCore-dev:megaavr",
54+ "manually_installed": true,
5555 "installed_version":"1.4.10",
5656 "releases": {
57- "1.4.10 ": {
57+ "": {
5858 "name":"DxCore"
5959 }
60- }
60+ },
61+ "installed_version": "",
62+ "latest_version": "",
63+ "has_manually_installed_release": true
6164 }
6265 ]
6366 }` )
@@ -512,63 +515,9 @@ func TestCoreListAllManuallyInstalledCore(t *testing.T) {
512515 requirejson .Contains (t , stdout , `{"platforms":[
513516 {
514517 "id": "arduino-beta-development:avr",
515- "latest_version": "1.8.3 ",
518+ "latest_version": "",
516519 "releases": {
517- "1.8.3": {
518- "name": "Arduino AVR Boards"
519- }
520- }
521- }
522- ]}` )
523- }
524-
525- func TestCoreListShowsLatestVersionWhenMultipleReleasesOfAManuallyInstalledCoreArePresent (t * testing.T ) {
526- env , cli := integrationtest .CreateArduinoCLIWithEnvironment (t )
527- defer env .CleanUp ()
528-
529- _ , _ , err := cli .Run ("core" , "update-index" )
530- require .NoError (t , err )
531-
532- // Verifies only cores in board manager are shown
533- stdout , _ , err := cli .Run ("core" , "list" , "--all" , "--json" )
534- require .NoError (t , err )
535- requirejson .Query (t , stdout , `.platforms | length > 0` , `true` )
536- length , err := strconv .Atoi (requirejson .Parse (t , stdout ).Query (".platforms | length" ).String ())
537- require .NoError (t , err )
538-
539- // Manually installs a core in sketchbooks hardware folder
540- gitUrl := "https://github.com/arduino/ArduinoCore-avr.git"
541- repoDir := cli .SketchbookDir ().Join ("hardware" , "arduino-beta-development" , "avr" )
542- _ , err = git .PlainClone (filepath .Join (repoDir .String (), "1.8.3" ), false , & git.CloneOptions {
543- URL : gitUrl ,
544- ReferenceName : plumbing .NewTagReferenceName ("1.8.3" ),
545- })
546- require .NoError (t , err )
547-
548- tmp := paths .New (t .TempDir (), "1.8.4" )
549- _ , err = git .PlainClone (tmp .String (), false , & git.CloneOptions {
550- URL : gitUrl ,
551- ReferenceName : plumbing .NewTagReferenceName ("1.8.4" ),
552- })
553- require .NoError (t , err )
554-
555- err = tmp .Rename (repoDir .Join ("1.8.4" ))
556- require .NoError (t , err )
557-
558- // When manually installing 2 releases of the same core, the newest one takes precedence
559- stdout , _ , err = cli .Run ("core" , "list" , "--all" , "--json" )
560- require .NoError (t , err )
561- requirejson .Query (t , stdout , `.platforms | length` , fmt .Sprint (length + 1 ))
562- requirejson .Contains (t , stdout , `{"platforms":[
563- {
564- "id": "arduino-beta-development:avr",
565- "latest_version": "1.8.4",
566- "installed_version": "1.8.4",
567- "releases": {
568- "1.8.3": {
569- "name": "Arduino AVR Boards"
570- },
571- "1.8.3": {
520+ "": {
572521 "name": "Arduino AVR Boards"
573522 }
574523 }
@@ -606,12 +555,15 @@ func TestCoreListUpdatableAllFlags(t *testing.T) {
606555 requirejson .Contains (t , stdout , `{"platforms":[
607556 {
608557 "id": "arduino-beta-development:avr",
609- "latest_version": "1.8.3",
558+ "manually_installed": true,
559+ "installed_version": "",
560+ "latest_version": "",
610561 "releases": {
611- "1.8.3 ": {
562+ "": {
612563 "name": "Arduino AVR Boards"
613564 }
614- }
565+ },
566+ "has_manually_installed_release": true
615567 }
616568 ]}` )
617569}
@@ -1009,7 +961,7 @@ func TestCoreWithMissingCustomBoardOptionsIsLoaded(t *testing.T) {
1009961 {
1010962 "id": "arduino-beta-dev:platform_with_missing_custom_board_options",
1011963 "releases": {
1012- "4.2.0 ": {
964+ "": {
1013965 "boards": [
1014966 {
1015967 "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno"
0 commit comments