@@ -96,18 +96,20 @@ func TestDownloadFallbackPlatform(t *testing.T) {
96
96
97
97
func TestDownload (t * testing.T ) {
98
98
testCases := []struct {
99
- name string
100
- version string
99
+ name string
100
+ version string
101
+ filesCreated []string
101
102
}{
102
- {"avrdude" , "6.3.0-arduino17" },
103
- {"bossac" , "1.6.1-arduino" },
104
- {"bossac" , "1.7.0-arduino3" },
105
- {"bossac" , "1.9.1-arduino2" },
106
- {"openocd" , "0.11.0-arduino2" },
107
- {"dfu-util" , "0.10.0-arduino1" },
108
- {"rp2040tools" , "1.0.6" },
109
- {"esptool_py" , "4.5.1" },
110
- {"arduino-fwuploader" , "2.2.2" },
103
+ {"avrdude" , "6.3.0-arduino17" , []string {"bin" , "etc" }},
104
+ {"bossac" , "1.6.1-arduino" , []string {"bossac" }},
105
+ {"bossac" , "1.7.0-arduino3" , []string {"bossac" }},
106
+ {"bossac" , "1.9.1-arduino2" , []string {"bossac" }},
107
+ {"openocd" , "0.11.0-arduino2" , []string {"bin" , "share" }},
108
+ {"dfu-util" , "0.10.0-arduino1" , []string {"dfu-prefix" , "dfu-suffix" , "dfu-util" }},
109
+ {"rp2040tools" , "1.0.6" , []string {"elf2uf2" , "picotool" , "pioasm" , "rp2040load" }},
110
+ {"esptool_py" , "4.5.1" , []string {"esptool" , "esptool.py" }},
111
+ {"arduino-fwuploader" , "2.2.2" , []string {"arduino-fwuploader" , "LICENSE.txt" }},
112
+ {"fwupdater" , "0.1.12" , []string {"firmwares" , "FirmwareUploader" , "LICENSE.txt" }}, // old legacy tool
111
113
}
112
114
// prepare the test environment
113
115
tempDir := t .TempDir ()
@@ -128,6 +130,16 @@ func TestDownload(t *testing.T) {
128
130
toolDir := tempDirPath .Join ("arduino-test" , tc .name , tc .version )
129
131
require .DirExists (t , toolDir .String ())
130
132
133
+ // Check that the files have been created
134
+ for _ , file := range tc .filesCreated {
135
+ filePath := toolDir .Join (file )
136
+ if filePath .IsDir () {
137
+ require .DirExists (t , filePath .String ())
138
+ } else {
139
+ require .FileExists (t , filePath .String ())
140
+ }
141
+ }
142
+
131
143
// Check that the tool has been installed
132
144
_ , ok := testTools .getMapValue (tc .name + "-" + tc .version )
133
145
require .True (t , ok )
0 commit comments