Advertisement
stiansjogren

Test

May 23rd, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.93 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4.  
  5. for filename in `ls *.dat`;do
  6.         file_key=`echo $filename | sed "s/\([a-z,1-9]*\)\..*/\1\.key/"`
  7.         key=`tail -1 $file_key | grep -oE "0x[0-9,a-f]{12}"`
  8.         files=100000
  9.         red_factor=32768
  10.         while [[ $red_factor -gt 1 && $files -le 100000 ]];do
  11.                 echo "tests in input: $files"
  12.                 count=`./ta_multithreading $filename $files | grep $key | wc -l`
  13.                 if [ $count -ne 0 ]
  14.                         then
  15.                              let files-=red_factor;
  16.                         else
  17.                              let red_factor/=2;
  18.                              let files+=red_factor;
  19.                         fi
  20.                 done
  21.         if [ $files -gt 100000 ]
  22.                 then
  23.                         echo "nu funziona nu cazzu"
  24.                 else
  25.                         echo "lowest number of tests in input: $files"
  26.                 fi
  27. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement