X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=host%2Fshavs_test.rb;h=e6a90d1555d5975a934138ade5d46c21437dd6dd;hb=58cf280bb781151e2cd91efd22d5ce9696b3aa62;hp=74d02c8f109fc539f4779d3300ac01de0db42f56;hpb=5c68d38237aa51b91a26309c24e8e38c7fbdffbe;p=avr-crypto-lib.git diff --git a/host/shavs_test.rb b/host/shavs_test.rb index 74d02c8..e6a90d1 100644 --- a/host/shavs_test.rb +++ b/host/shavs_test.rb @@ -57,13 +57,14 @@ def send_md(md_string) $sp.print(md_string[i].chr) # print("DBG s: "+ md_string[i].chr) if $debug if(i%20==19) - sleep(0.1) + sleep(0.01) end end end def run_test(filename) errors = 0 + line=1 if not File.exist?(filename) puts("ERROR file "+filename+" does not exist!") end @@ -91,12 +92,14 @@ def run_test(filename) b = (/[\s]*MD[\s]*=[\s]*([0-9a-fA-F]*).*/.match(avr_md))[1]; a.upcase! b.upcase! - puts("") if (pos%$linewidth==0 and $linewidth!=0) + printf("\n%4d: ", line) if (pos%$linewidth==0 and $linewidth!=0) + line += 1 if (pos%$linewidth==0 and $linewidth!=0) #putc((a==b)?'*':'!') if(a==b) putc('*') else putc('!') + # printf("\nshould: %s\ngot: %s\n",lb,avr_md) errors += 1; end pos += 1 @@ -131,9 +134,9 @@ init_system() for i in (5..(ARGV.size-1)) errors = run_test(ARGV[i]) if errors == 0 - puts("[ok]") + puts("\n[ok]") else - puts("[errors: "+errors.to_s+"]") + puts("\n[errors: "+errors.to_s+"]") end end $sp.print("EXIT\r");