Skip to content

Commit b4a6e41

Browse files
committed
Added test for burn bootloader with bootloader.tool options override
1 parent 5f4f32a commit b4a6e41

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

commands/upload/testdata/hardware/alice/avr/platform.txt

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,18 @@ tools.one-extra-params.program.pattern={cmd.path} {conf.board} {conf.general} {p
6262

6363
# Upload with programmer test 1
6464
tools.two.cmd.path=echo
65-
tools.two.conf.general=conf-general
66-
tools.two.upload.conf=conf-upload
67-
tools.two.upload.params.verbose=verbose
68-
tools.two.upload.params.quiet=quiet
69-
tools.two.upload.params.verify=verify
70-
tools.two.upload.params.noverify=noverify
71-
tools.two.upload.pattern={cmd.path} two {conf.board} {conf.general} {upload.conf} {upload.verbose} {upload.verify} {upload.protocol} "{serial.port}" -b{upload.speed} "{build.path}/{build.project_name}.hex"
65+
tools.two.conf.general=conf-two-general
66+
67+
tools.two.erase.conf=conf-two-erase
68+
tools.two.erase.params.verbose=verbose
69+
tools.two.erase.params.quiet=quiet
70+
tools.two.erase.params.verify=verify
71+
tools.two.erase.params.noverify=noverify
72+
tools.two.erase.pattern={cmd.path} ERASE {conf.board} {conf.general} {erase.conf} {erase.verbose} {erase.verify} {bootloader.protocol} "{serial.port}" -b{upload.speed}
73+
74+
tools.two.bootloader.conf=conf-two-bootloader
75+
tools.two.bootloader.params.verbose=verbose
76+
tools.two.bootloader.params.quiet=quiet
77+
tools.two.bootloader.params.verify=verify
78+
tools.two.bootloader.params.noverify=noverify
79+
tools.two.bootloader.pattern={cmd.path} BURN {conf.board} {conf.general} {bootloader.conf} {bootloader.verbose} {bootloader.verify} {bootloader.protocol} "{serial.port}" -b{upload.speed} -F{bootloader.fuses} "{runtime.platform.path}/bootloaders/{bootloader.file}"

commands/upload/testdata/hardware/alice/avr/programmers.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ progr3.program.tool=one-extra-params
1313
progr3.program.extra_params={serial.port}
1414

1515
progr4.name=Programmer 4
16-
progr4.program.protocol=prog4protocol
16+
progr4.program.protocol=prog4protocol-upload
1717
progr4.program.tool=one
1818
progr4.bootloader.protocol=prog4protocol-bootloader
19-
progr4.bootloader.tool=one
20-
progr4.protocol=genprog4protocol
19+
progr4.bootloader.tool=two

commands/upload/upload_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ func TestUploadPropertiesComposition(t *testing.T) {
166166
{buildPath1, "alice:avr:board1", "port", "progr1", true,
167167
"ERASE conf-board1 conf-general conf-erase $$VERBOSE-VERIFY$$ genprog1protocol port -bspeed",
168168
"BURN conf-board1 conf-general conf-bootloader $$VERBOSE-VERIFY$$ genprog1protocol port -bspeed -F0xFF " + cwd + "/testdata/hardware/alice/avr/bootloaders/niceboot/niceboot.hex"},
169+
170+
// 12: burn bootloader, preferences override from programmers.txt
171+
{buildPath1, "alice:avr:board1", "port", "progr4", true,
172+
"ERASE conf-board1 conf-two-general conf-two-erase $$VERBOSE-VERIFY$$ prog4protocol-bootloader port -bspeed",
173+
"BURN conf-board1 conf-two-general conf-two-bootloader $$VERBOSE-VERIFY$$ prog4protocol-bootloader port -bspeed -F0xFF " + cwd + "/testdata/hardware/alice/avr/bootloaders/niceboot/niceboot.hex"},
169174
}
170175
for i, test := range tests {
171176
t.Run(fmt.Sprintf("SubTest%02d", i), func(t *testing.T) {

0 commit comments

Comments
 (0)