summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2011-01-15 23:42:39 +0100
committerMichael Buesch <mb@bu3sch.de>2011-01-15 23:42:39 +0100
commite437784362098ebe71e6c61703ca083ad9f40c50 (patch)
treef08eda583a94b57466a8d89c13fa3ec33b9804fc /tests
parent6774e5978c149e858bfc45446bfed8249a491b72 (diff)
downloadtoprammer-e437784362098ebe71e6c61703ca083ad9f40c50.tar.xz
toprammer-e437784362098ebe71e6c61703ca083ad9f40c50.zip
Add common chip shutdown implementation
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run-tests.sh10
-rw-r--r--tests/top2049/001-atmega32dip40.test22
-rw-r--r--tests/top2049/001-atmega88dip28.test22
-rw-r--r--tests/top2049/001-atmega8dip28.test22
-rw-r--r--tests/top2049/001-attiny13dip8.test22
-rw-r--r--tests/top2049/002-at89c2051dip20.test10
-rw-r--r--tests/top2049/003-w29ee011dip32.test8
-rw-r--r--tests/top2049/004-hm62256dip28.test6
-rw-r--r--tests/top2049/005-m24c08.test6
9 files changed, 61 insertions, 67 deletions
diff --git a/tests/run-tests.sh b/tests/run-tests.sh
index 184698b..0e7fcb7 100755
--- a/tests/run-tests.sh
+++ b/tests/run-tests.sh
@@ -52,6 +52,9 @@ function toprammer
local args="$@"
local logfile="$tmpdir/toprammer.log"
+ [ -n "$current_chipid" ] && args="$args --chip-id $current_chipid"
+ args="$args -I bin -O bin"
+
echo " toprammer $args"
cd "$basedir/.." || die "Failed to chdir"
if [ $verbose -eq 0 ]; then
@@ -108,6 +111,11 @@ function request
function request_DUT # $1=DUT-name
{
local dut="$1"
+
+ current_chipid="$dut"
+ # Init the programmer
+ toprammer --force-upload
+ # Show layout
toprammer_layout -d "$current_device" -p "$dut" --only-insert
request "Please insert a $dut into the ZIF socket (x to skip; a to abort)..."
}
@@ -174,6 +182,7 @@ done
current_test=
current_device=
+current_chipid=
cleanup
mkdir -p "$tmpdir"
[ $? -eq 0 ] || die "Failed to create $tmpdir"
@@ -249,6 +258,7 @@ function do_run_test # $1=device, $2=testscript
current_device=
current_test=
+ current_chipid=
}
if [ $nr_scriptpaths -eq 0 ]; then
diff --git a/tests/top2049/001-atmega32dip40.test b/tests/top2049/001-atmega32dip40.test
index 0820421..e7c7255 100644
--- a/tests/top2049/001-atmega32dip40.test
+++ b/tests/top2049/001-atmega32dip40.test
@@ -8,32 +8,30 @@ function test_init
function test_run
{
- local args="-c atmega32dip40 -I bin -O bin"
-
# Check signature
- toprammer $args --read-sig "$tmpfile"
+ toprammer --read-sig "$tmpfile"
compare_file_to_hex "$tmpfile" "1E9502" || die "signature mismatch"
- toprammer $args --erase
+ toprammer --erase
# Check progmem
- toprammer $args --write-prog "$testfile_32k"
- toprammer $args --read-prog "$tmpfile"
+ toprammer --write-prog "$testfile_32k"
+ toprammer --read-prog "$tmpfile"
compare_files "$testfile_32k" "$tmpfile" || die "progmem mismatch"
# Check EEPROM
- toprammer $args --write-eeprom "$testfile_1k"
- toprammer $args --read-eeprom "$tmpfile"
+ toprammer --write-eeprom "$testfile_1k"
+ toprammer --read-eeprom "$tmpfile"
compare_files "$testfile_1k" "$tmpfile" || die "EEPROM mismatch"
# Check fuses
testfuses="A4D9"
- echo "0x0000: $testfuses" | toprammer $args -I hex --write-fuse -
- toprammer $args --read-fuse "$tmpfile"
+ echo "0x0000: $testfuses" | toprammer -I hex --write-fuse -
+ toprammer --read-fuse "$tmpfile"
compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch"
# Check lockbits
- toprammer $args --read-lock "$tmpfile"
+ toprammer --read-lock "$tmpfile"
compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch"
- toprammer $args --write-lock "$tmpfile"
+ toprammer --write-lock "$tmpfile"
}
diff --git a/tests/top2049/001-atmega88dip28.test b/tests/top2049/001-atmega88dip28.test
index 4dd6d11..2e0ca8f 100644
--- a/tests/top2049/001-atmega88dip28.test
+++ b/tests/top2049/001-atmega88dip28.test
@@ -8,32 +8,30 @@ function test_init
function test_run
{
- local args="-c atmega88dip28 -I bin -O bin"
-
# Check signature
- toprammer $args --read-sig "$tmpfile"
+ toprammer --read-sig "$tmpfile"
compare_file_to_hex "$tmpfile" "1E930A" || die "signature mismatch"
- toprammer $args --erase
+ toprammer --erase
# Check progmem
- toprammer $args --write-prog "$testfile_8k"
- toprammer $args --read-prog "$tmpfile"
+ toprammer --write-prog "$testfile_8k"
+ toprammer --read-prog "$tmpfile"
compare_files "$testfile_8k" "$tmpfile" || die "progmem mismatch"
# Check EEPROM
- toprammer $args --write-eeprom "$testfile_512"
- toprammer $args --read-eeprom "$tmpfile"
+ toprammer --write-eeprom "$testfile_512"
+ toprammer --read-eeprom "$tmpfile"
compare_files "$testfile_512" "$tmpfile" || die "EEPROM mismatch"
# Check fuses
#TODO testfuses="E1D9"
-# echo "0x0000: $testfuses" | toprammer $args -I hex --write-fuse -
-# toprammer $args --read-fuse "$tmpfile"
+# echo "0x0000: $testfuses" | toprammer -I hex --write-fuse -
+# toprammer --read-fuse "$tmpfile"
# compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch"
# Check lockbits
- toprammer $args --read-lock "$tmpfile"
+ toprammer --read-lock "$tmpfile"
compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch"
- toprammer $args --write-lock "$tmpfile"
+ toprammer --write-lock "$tmpfile"
}
diff --git a/tests/top2049/001-atmega8dip28.test b/tests/top2049/001-atmega8dip28.test
index d519adb..32133b7 100644
--- a/tests/top2049/001-atmega8dip28.test
+++ b/tests/top2049/001-atmega8dip28.test
@@ -8,32 +8,30 @@ function test_init
function test_run
{
- local args="-c atmega8dip28 -I bin -O bin"
-
# Check signature
- toprammer $args --read-sig "$tmpfile"
+ toprammer --read-sig "$tmpfile"
compare_file_to_hex "$tmpfile" "1E9307" || die "signature mismatch"
- toprammer $args --erase
+ toprammer --erase
# Check progmem
- toprammer $args --write-prog "$testfile_8k"
- toprammer $args --read-prog "$tmpfile"
+ toprammer --write-prog "$testfile_8k"
+ toprammer --read-prog "$tmpfile"
compare_files "$testfile_8k" "$tmpfile" || die "progmem mismatch"
# Check EEPROM
- toprammer $args --write-eeprom "$testfile_512"
- toprammer $args --read-eeprom "$tmpfile"
+ toprammer --write-eeprom "$testfile_512"
+ toprammer --read-eeprom "$tmpfile"
compare_files "$testfile_512" "$tmpfile" || die "EEPROM mismatch"
# Check fuses
testfuses="E1D9"
- echo "0x0000: $testfuses" | toprammer $args -I hex --write-fuse -
- toprammer $args --read-fuse "$tmpfile"
+ echo "0x0000: $testfuses" | toprammer -I hex --write-fuse -
+ toprammer --read-fuse "$tmpfile"
compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch"
# Check lockbits
- toprammer $args --read-lock "$tmpfile"
+ toprammer --read-lock "$tmpfile"
compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch"
- toprammer $args --write-lock "$tmpfile"
+ toprammer --write-lock "$tmpfile"
}
diff --git a/tests/top2049/001-attiny13dip8.test b/tests/top2049/001-attiny13dip8.test
index 75f12f9..4411bb9 100644
--- a/tests/top2049/001-attiny13dip8.test
+++ b/tests/top2049/001-attiny13dip8.test
@@ -8,32 +8,30 @@ function test_init
function test_run
{
- local args="-c attiny13dip8 -I bin -O bin"
-
# Check signature
- toprammer $args --read-sig "$tmpfile"
+ toprammer --read-sig "$tmpfile"
compare_file_to_hex "$tmpfile" "1E9007" || die "signature mismatch"
- toprammer $args --erase
+ toprammer --erase
# Check progmem
- toprammer $args --write-prog "$testfile_1k"
- toprammer $args --read-prog "$tmpfile"
+ toprammer --write-prog "$testfile_1k"
+ toprammer --read-prog "$tmpfile"
compare_files "$testfile_1k" "$tmpfile" || die "progmem mismatch"
# Check EEPROM
- toprammer $args --write-eeprom "$testfile_64"
- toprammer $args --read-eeprom "$tmpfile"
+ toprammer --write-eeprom "$testfile_64"
+ toprammer --read-eeprom "$tmpfile"
compare_files "$testfile_64" "$tmpfile" || die "EEPROM mismatch"
# Check fuses
testfuses="6AFF"
- echo "0x0000: $testfuses" | toprammer $args -I hex --write-fuse -
- toprammer $args --read-fuse "$tmpfile"
+ echo "0x0000: $testfuses" | toprammer -I hex --write-fuse -
+ toprammer --read-fuse "$tmpfile"
compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch"
# Check lockbits
- toprammer $args --read-lock "$tmpfile"
+ toprammer --read-lock "$tmpfile"
compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch"
- toprammer $args --write-lock "$tmpfile"
+ toprammer --write-lock "$tmpfile"
}
diff --git a/tests/top2049/002-at89c2051dip20.test b/tests/top2049/002-at89c2051dip20.test
index 37bc88b..40fe8fd 100644
--- a/tests/top2049/002-at89c2051dip20.test
+++ b/tests/top2049/002-at89c2051dip20.test
@@ -8,16 +8,14 @@ function test_init
function test_run
{
- local args="-c at89c2051dip20 -I bin -O bin"
-
# Check signature
- toprammer $args --read-sig "$tmpfile"
+ toprammer --read-sig "$tmpfile"
compare_file_to_hex $tmpfile "1E21" || die "signature mismatch"
- toprammer $args --erase
+ toprammer --erase
# Check progmem
- toprammer $args --write-prog "$testfile_2k"
- toprammer $args --read-prog "$tmpfile"
+ toprammer --write-prog "$testfile_2k"
+ toprammer --read-prog "$tmpfile"
compare_files "$testfile_2k" "$tmpfile" || die "progmem mismatch"
}
diff --git a/tests/top2049/003-w29ee011dip32.test b/tests/top2049/003-w29ee011dip32.test
index 385960a..ad8a619 100644
--- a/tests/top2049/003-w29ee011dip32.test
+++ b/tests/top2049/003-w29ee011dip32.test
@@ -8,11 +8,9 @@ function test_init
function test_run
{
- local args="-c w29ee011dip32 -I bin -O bin"
+ toprammer --erase
- toprammer $args --erase
-
- toprammer $args --write-eeprom "$testfile_128k"
- toprammer $args --read-eeprom "$tmpfile"
+ toprammer --write-eeprom "$testfile_128k"
+ toprammer --read-eeprom "$tmpfile"
compare_files "$testfile_128k" "$tmpfile" || die "EEPROM mismatch"
}
diff --git a/tests/top2049/004-hm62256dip28.test b/tests/top2049/004-hm62256dip28.test
index deb865c..84a7279 100644
--- a/tests/top2049/004-hm62256dip28.test
+++ b/tests/top2049/004-hm62256dip28.test
@@ -8,9 +8,7 @@ function test_init
function test_run
{
- local args="-c hm62256dip28 -I bin -O bin"
-
- toprammer $args --write-ram "$testfile_32k"
- toprammer $args --read-ram "$tmpfile"
+ toprammer --write-ram "$testfile_32k"
+ toprammer --read-ram "$tmpfile"
compare_files "$testfile_32k" "$tmpfile" || die "RAM mismatch"
}
diff --git a/tests/top2049/005-m24c08.test b/tests/top2049/005-m24c08.test
index 7c05282..89c1b7f 100644
--- a/tests/top2049/005-m24c08.test
+++ b/tests/top2049/005-m24c08.test
@@ -8,9 +8,7 @@ function test_init
function test_run
{
- local args="-c m24c08dip8 -I bin -O bin"
-
- toprammer $args --write-eeprom "$testfile_1k"
- toprammer $args --read-eeprom "$tmpfile"
+ toprammer --write-eeprom "$testfile_1k"
+ toprammer --read-eeprom "$tmpfile"
compare_files "$testfile_1k" "$tmpfile" || die "EEPROM mismatch"
}
bues.ch cgit interface