This adds checks for zombie sourcecode problems, i.e. problems
we have tried to eliminate but which might be or have been
resurrected.
The example check is for the problematic
#include "ac_cfg.h"
with double quotes instead of <> which were identified as a
problem in https://github.com/avrdudes/avrdude/issues/1706
and then fixed.
Macos ships a quite old version of bash (3.x) which does not have
associative arrays (declare -A) yet.
As the test-avrdude script only uses one associative array
for a static mapping of one character strings to one word
strings, this can be easily replaced by a shell function
containing a "case" statement.
Before this fix:
2024-08-15T15:39:59.9596380Z Prepare "-cdryrun -pm2560" and press 'enter' or 'space' to continue. Press any other key to skip
2024-08-15T15:40:00.5796130Z ✅ 0.155 s: flash raw format -T/-U write/verify cola-vending-machine.raw
2024-08-15T15:40:00.7006170Z ✅ 0.111 s: flash extended address and hole test
2024-08-15T15:40:00.7057180Z ./tools/test-avrdude: line 322: declare: -A: invalid option
2024-08-15T15:40:00.7057750Z declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
2024-08-15T15:40:00.9218810Z ✅ 0.212 s: flash writing R numbers
2024-08-15T15:40:01.1793950Z ✅ 0.240 s: flash reading and verifying R numbers
2024-08-15T15:40:01.3661060Z ✅ 0.173 s: flash writing R numbers
2024-08-15T15:40:01.6317540Z ✅ 0.254 s: flash reading and verifying R numbers
2024-08-15T15:40:01.8235780Z ✅ 0.182 s: flash writing R numbers
2024-08-15T15:40:02.0724260Z ✅ 0.239 s: flash reading and verifying R numbers
2024-08-15T15:40:02.2713120Z ✅ 0.188 s: flash writing R numbers
2024-08-15T15:40:02.4497490Z ✅ 0.162 s: flash reading and verifying R numbers
2024-08-15T15:40:02.5897960Z ✅ 0.128 s: flash writing R numbers
2024-08-15T15:40:02.8667350Z ✅ 0.263 s: flash reading and verifying R numbers
2024-08-15T15:40:03.0635260Z ✅ 0.181 s: flash writing srec format
2024-08-15T15:40:03.2152560Z ✅ 0.142 s: flash reading and verifying srec format file
After this fix:
2024-08-15T17:23:24.5161820Z Prepare "-cdryrun -pm2560" and press 'enter' or 'space' to continue. Press any other key to skip
2024-08-15T17:23:25.1088990Z ✅ 0.162 s: flash raw format -T/-U write/verify cola-vending-machine.raw
2024-08-15T17:23:25.2742090Z ✅ 0.157 s: flash extended address and hole test
2024-08-15T17:23:25.4795650Z ✅ 0.196 s: flash writing binary numbers
2024-08-15T17:23:25.6721130Z ✅ 0.180 s: flash reading and verifying binary numbers
2024-08-15T17:23:25.8423490Z ✅ 0.161 s: flash writing octal numbers
2024-08-15T17:23:26.0901770Z ✅ 0.235 s: flash reading and verifying octal numbers
2024-08-15T17:23:26.2308860Z ✅ 0.127 s: flash writing decimal numbers
2024-08-15T17:23:26.4667010Z ✅ 0.228 s: flash reading and verifying decimal numbers
2024-08-15T17:23:26.6574670Z ✅ 0.180 s: flash writing hexadecimal numbers
2024-08-15T17:23:26.8651240Z ✅ 0.200 s: flash reading and verifying hexadecimal numbers
2024-08-15T17:23:27.0446640Z ✅ 0.168 s: flash writing R numbers
2024-08-15T17:23:27.3074230Z ✅ 0.250 s: flash reading and verifying R numbers
2024-08-15T17:23:27.4962750Z ✅ 0.179 s: flash writing srec format
2024-08-15T17:23:27.6594570Z ✅ 0.150 s: flash reading and verifying srec format file
The output of the version information in "avrdude -v" has changed between
avrdude 7.3 and now (commit cf0822bb71):
avrdude: Version 7.3
Avrdude version 7.3-20240814 (250a663a)
This means that the old grep call looking for "Version" cannot
find anything any more, and therefore needs to be changed.
This was not discovered as the test-avrdude script neglected to
abort if no version information is found.
Remove SVN $Id$ tags from source files which have been made
obsolete by moving to git and serve no purpose any more.
This mostly removes the matches printed by the command
git grep -E '\$[A-Za-z]+\$'
The remaining exceptions are some binary files (PDF and font files),
and jquery js files with both $Id$ and $Date$ tags.
The cumulative time for typical user tasks depends on the flash and EEPROM
size of the part. This commit computes a size-normalised time. Lower is
better. This avrbench number still depends on the part, but less so than
the cumulative time of the tasks.
The summary line is put in vertical bars to make creation of markdown
tables easier.
This executes five tests for typical programming tasks:
- Write/verify a "difficult" sketch to flash: two code sections and one
data section separated by "holes" of different sizes
- Dump all flash, eg, to make a backup
- Write/verify a "difficult" eeprom data file with holes
- Dump all eeprom, eg, to make a backup
- Chip erase (bootloaders are expected to page erase flash apart from
the bootloader itself) and spot check whether flash was erased
The reported times are realistic times with overhead of starting avrdude,
resetting the board via DTR/RTS, establishing comms, including erasing the
flash before writing/verifying the sketch and disengaging the chip.
$ test-avrdude -b -d 0 \
-p "u7.7/weu-jPrac -c urclock -P ch340 -p m328p -b 1000000" \
-p "u7.7/-eu-jPrac -c urclock -P ch340 -p m328p -b 1000000"
Testing avrdude version 7.3-20240225 (20788712)
Prepare "u7.7/weu-jPrac -c urclock -P ch340 -p m328p -b 1000000" and press 'enter' or 'space' to continue. Press any other key to skip
✅ 2.174 s: flash -U write/verify holes_rjmp_loops_32768B.hex
✅ 1.339 s: flash -U read all flash
✅ 1.415 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
✅ 1.034 s: eeprom -U read all
✅ 1.604 s: chip erase and spot check flash is actually erased
✅ 7.566 s: benchmark for u7.7/weu-jPrac -c urclock -P ch340 -p m328p -b 1000000
Prepare "u7.7/-eu-jPrac -c urclock -P ch340 -p m328p -b 1000000" and press 'enter' or 'space' to continue. Press any other key to skip
✅ 2.001 s: flash -U write/verify holes_rjmp_loops_32768B.hex
✅ 1.333 s: flash -U read all flash
✅ 1.405 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
✅ 1.029 s: eeprom -U read all
✅ 1.618 s: chip erase and spot check flash is actually erased
✅ 7.386 s: benchmark for u7.7/-eu-jPrac -c urclock -P ch340 -p m328p -b 1000000
Note the benchmark line with the cumulative time for all five tasks
- Simplify command to make eesave fusebit delete EEPROM on chip erase
- Replace ${var,,} construct with tr A-Z a-z so older bash shells work
- Make -l work for fuse access tests
$ tools/test-avrdude -h
Syntax: test-avrdude {<opts>}
Function: test AVRDUDE for certain programmer and part combinations
Options:
-c <configuration spec> additional configuration options used for all runs
-d <sec> delay between test commands (default 4 seconds)
-e <avrdude path> set path of AVRDUDE executable (default avrdude)
-l list test commands but do not execute them
-p <programmer/part specs> can be used multiple times, overrides default tests
-s skip EEPROM tests for bootloaders
-v verbose: show AVRDUDE error and warning messages
-? or -h show this help text
Example:
$ test-avrdude -d 0 -p "-c dryrun -p t13" -p "-c dryrun -p m4809"
$ echo | tools/test-avrdude -p"-cdryrun -pm328p" -d0
Testing avrdude version 7.2-20240128 (09345002)
Prepare "-cdryrun -pm328p" and press 'enter' or 'space' to continue. Press any other key to skip
✅ 0.064 s: fuse access: clear, set and read eesave fuse bit
✅ 0.083 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
✅ 0.066 s: chip erase
✅ 0.068 s: flash -U write/verify holes_rjmp_loops_32768B.hex
✅ 0.067 s: flash -T write/verify holes_rjmp_loops_32768B.hex
✅ 0.067 s: eeprom check whether programmer can flip 0s to 1s
✅ 0.067 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
✅ 0.066 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_1024B.hex
✅ 0.069 s: chip erase and spot check flash is actually erased
✅ 0.067 s: spot check eeprom is erased, too