@@ -105,18 +105,20 @@ func TestDownloadFallbackPlatform(t *testing.T) {
105105
106106func TestDownload (t * testing.T ) {
107107 testCases := []struct {
108- name string
109- version string
108+ name string
109+ version string
110+ filesCreated []string
110111 }{
111- {"avrdude" , "6.3.0-arduino17" },
112- {"bossac" , "1.6.1-arduino" },
113- {"bossac" , "1.7.0-arduino3" },
114- {"bossac" , "1.9.1-arduino2" },
115- {"openocd" , "0.11.0-arduino2" },
116- {"dfu-util" , "0.10.0-arduino1" },
117- {"rp2040tools" , "1.0.6" },
118- {"esptool_py" , "4.5.1" },
119- {"arduino-fwuploader" , "2.2.2" },
112+ {"avrdude" , "6.3.0-arduino17" , []string {"bin" , "etc" }},
113+ {"bossac" , "1.6.1-arduino" , []string {"bossac" }},
114+ {"bossac" , "1.7.0-arduino3" , []string {"bossac" }},
115+ {"bossac" , "1.9.1-arduino2" , []string {"bossac" }},
116+ {"openocd" , "0.11.0-arduino2" , []string {"bin" , "share" }},
117+ {"dfu-util" , "0.10.0-arduino1" , []string {"dfu-prefix" , "dfu-suffix" , "dfu-util" }},
118+ {"rp2040tools" , "1.0.6" , []string {"elf2uf2" , "picotool" , "pioasm" , "rp2040load" }},
119+ {"esptool_py" , "4.5.1" , []string {"esptool" , "esptool.py" }},
120+ {"arduino-fwuploader" , "2.2.2" , []string {"arduino-fwuploader" , "LICENSE.txt" }},
121+ {"fwupdater" , "0.1.12" , []string {"firmwares" , "FirmwareUploader" , "LICENSE.txt" }}, // old legacy tool
120122 }
121123 // prepare the test environment
122124 tempDir := t .TempDir ()
@@ -137,6 +139,16 @@ func TestDownload(t *testing.T) {
137139 toolDir := tempDirPath .Join ("arduino-test" , tc .name , tc .version )
138140 require .DirExists (t , toolDir .String ())
139141
142+ // Check that the files have been created
143+ for _ , file := range tc .filesCreated {
144+ filePath := toolDir .Join (file )
145+ if filePath .IsDir () {
146+ require .DirExists (t , filePath .String ())
147+ } else {
148+ require .FileExists (t , filePath .String ())
149+ }
150+ }
151+
140152 // Check that the tool has been installed
141153 _ , ok := testTools .getMapValue (tc .name + "-" + tc .version )
142154 require .True (t , ok )
0 commit comments