summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2015-11-26 20:05:22 +0100
committerMichael Buesch <m@bues.ch>2015-11-26 20:05:22 +0100
commit1380c2c4e73c07de307873b07dce698779c3cf2a (patch)
tree12033fdeb87b796ee7e994d3100a7cfce952082f
parent82924fd72c4c4d876beabaee00100c00af2b3d31 (diff)
downloadtoprammer-1380c2c4e73c07de307873b07dce698779c3cf2a.tar.xz
toprammer-1380c2c4e73c07de307873b07dce698779c3cf2a.zip
Add testcase for AtMega328P
Signed-off-by: Michael Buesch <m@bues.ch>
-rw-r--r--tests/top2049/atmega328pdip28.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/top2049/atmega328pdip28.test b/tests/top2049/atmega328pdip28.test
new file mode 100644
index 0000000..6fcdb4f
--- /dev/null
+++ b/tests/top2049/atmega328pdip28.test
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+test_init()
+{
+ request_DUT "atmega328pdip28" || return 1
+ return 0
+}
+
+test_run()
+{
+ # Check signature
+ toprammer --read-sig "$tmpfile"
+ compare_file_to_hex "$tmpfile" "1E950F" || die "signature mismatch"
+
+ toprammer --erase
+
+ # Check progmem
+ toprammer --write-prog "$testfile_32k"
+ toprammer --read-prog "$tmpfile"
+ compare_files "$testfile_32k" "$tmpfile" || die "progmem mismatch"
+
+ # Check EEPROM
+ toprammer --write-eeprom "$testfile_1k"
+ toprammer --read-eeprom "$tmpfile"
+ compare_files "$testfile_1k" "$tmpfile" || die "EEPROM mismatch"
+
+ # Check fuses
+ local testfuses="E2D9FC"
+ echo "0x0000: $testfuses" | toprammer -I ahex --write-fuse -
+ toprammer --read-fuse "$tmpfile"
+ compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch"
+
+ # Check lockbits
+ toprammer --read-lock "$tmpfile"
+ compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch"
+ toprammer --write-lock "$tmpfile"
+}
bues.ch cgit interface