@@ -20,6 +20,7 @@ import (
2020
2121 "github.com/arduino/arduino-cli/internal/integrationtest"
2222 "github.com/arduino/go-paths-helper"
23+ "github.com/arduino/go-properties-orderedmap"
2324 "github.com/stretchr/testify/require"
2425)
2526
@@ -46,20 +47,26 @@ func TestRuntimeToolPropertiesGeneration(t *testing.T) {
4647 for i := 0 ; i < 3 ; i ++ {
4748 stdout , _ , err := cli .Run ("compile" , "-b" , "alice:avr:alice" , "--show-properties" , sketch .String ())
4849 require .NoError (t , err )
50+ res , err := properties .LoadFromBytes (stdout )
51+ require .NoError (t , err )
4952 // the tools coming from the same packager are selected
50- require .Contains (t , string ( stdout ), "runtime.tools.avr-gcc.path=" + hardwareDir .String () + "/ alice/ tools/ avr-gcc/ 50.0.0" )
51- require .Contains (t , string ( stdout ), "runtime.tools.avrdude.path=" + hardwareDir .String () + "/ alice/ tools/ avrdude/ 1.0.0" )
53+ require .True (t , res . GetPath ( "runtime.tools.avr-gcc.path" ). EquivalentTo ( hardwareDir .Join ( " alice" , " tools" , " avr-gcc" , " 50.0.0")) )
54+ require .True (t , res . GetPath ( "runtime.tools.avrdude.path" ). EquivalentTo ( hardwareDir .Join ( " alice" , " tools" , " avrdude" , " 1.0.0")) )
5255
5356 stdout , _ , err = cli .Run ("compile" , "-b" , "bob:avr:bob" , "--show-properties" , sketch .String ())
5457 require .NoError (t , err )
58+ res , err = properties .LoadFromBytes (stdout )
59+ require .NoError (t , err )
5560 // the latest version available are selected
56- require .Contains (t , string ( stdout ), "runtime.tools.avr-gcc.path=" + hardwareDir .String () + "/ alice/ tools/ avr-gcc/ 50.0.0" )
57- require .Contains (t , string ( stdout ), "runtime.tools.avrdude.path=" + hardwareDir .String () + "/ arduino/ tools/ avrdude/ 6.3.0-arduino17" )
61+ require .True (t , res . GetPath ( "runtime.tools.avr-gcc.path" ). EquivalentTo ( hardwareDir .Join ( " alice" , " tools" , " avr-gcc" , " 50.0.0")) )
62+ require .True (t , res . GetPath ( "runtime.tools.avrdude.path" ). EquivalentTo ( hardwareDir .Join ( " arduino" , " tools" , " avrdude" , " 6.3.0-arduino17")) )
5863
5964 stdout , _ , err = cli .Run ("compile" , "-b" , "arduino:avr:uno" , "--show-properties" , sketch .String ())
6065 require .NoError (t , err )
66+ res , err = properties .LoadFromBytes (stdout )
67+ require .NoError (t , err )
6168 // the selected tools are listed as platform dependencies from the index.json
62- require .Contains (t , string ( stdout ), "runtime.tools.avr-gcc.path=" + hardwareDir .String () + "/ arduino/ tools/ avr-gcc/ 7.3.0-atmel3.6.1-arduino7" )
63- require .Contains (t , string ( stdout ), "runtime.tools.avrdude.path=" + hardwareDir .String () + "/ arduino/ tools/ avrdude/ 6.3.0-arduino17" )
69+ require .True (t , res . GetPath ( "runtime.tools.avr-gcc.path" ). EquivalentTo ( hardwareDir .Join ( " arduino" , " tools" , " avr-gcc" , " 7.3.0-atmel3.6.1-arduino7")) )
70+ require .True (t , res . GetPath ( "runtime.tools.avrdude.path" ). EquivalentTo ( hardwareDir .Join ( " arduino" , " tools" , " avrdude" , " 6.3.0-arduino17")) )
6471 }
6572}
0 commit comments