@@ -20,6 +20,7 @@ import (
20
20
21
21
"github.com/arduino/arduino-cli/internal/integrationtest"
22
22
"github.com/arduino/go-paths-helper"
23
+ "github.com/arduino/go-properties-orderedmap"
23
24
"github.com/stretchr/testify/require"
24
25
)
25
26
@@ -46,20 +47,26 @@ func TestRuntimeToolPropertiesGeneration(t *testing.T) {
46
47
for i := 0 ; i < 3 ; i ++ {
47
48
stdout , _ , err := cli .Run ("compile" , "-b" , "alice:avr:alice" , "--show-properties" , sketch .String ())
48
49
require .NoError (t , err )
50
+ res , err := properties .LoadFromBytes (stdout )
51
+ require .NoError (t , err )
49
52
// 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")) )
52
55
53
56
stdout , _ , err = cli .Run ("compile" , "-b" , "bob:avr:bob" , "--show-properties" , sketch .String ())
54
57
require .NoError (t , err )
58
+ res , err = properties .LoadFromBytes (stdout )
59
+ require .NoError (t , err )
55
60
// 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")) )
58
63
59
64
stdout , _ , err = cli .Run ("compile" , "-b" , "arduino:avr:uno" , "--show-properties" , sketch .String ())
60
65
require .NoError (t , err )
66
+ res , err = properties .LoadFromBytes (stdout )
67
+ require .NoError (t , err )
61
68
// 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")) )
64
71
}
65
72
}
0 commit comments