pz12

This is a task for our favourite professor
git clone git://git.stellar-nexus.ru/pz12
Log | Files | Refs | Submodules

make_tests.sh (789B)


      1 #!/bin/sh
      2 for i in $(seq 1 $1); do
      3 	testnumber1=$(($(ls -l test1/input* | wc -l) + 1))
      4 	testnumber2=$(($(ls -l test2/input* | wc -l) + 1))
      5 	head -80 /dev/urandom | od -An -w2 -tu2 | sed 's/ //g' | sed 's/*/10/g' > test1/input$testnumber1
      6 	head -80 /dev/urandom | od -An -w2 -tu2 | sed 's/ //g' | sed 's/*/10/g' > test2/input$testnumber2
      7 	
      8 	printf "$((($(wc -l test1/input$testnumber1 | cut -d\  -f 1) - 1) / 2))\n$(cat test1/input$testnumber1)" | sponge test1/input$testnumber1
      9 	printf "$(wc -l test2/input$testnumber2 | cut -d\  -f 1)\n$(cat test2/input$testnumber2)" | sponge test2/input$testnumber2
     10 	
     11 	./gavrilov/bell  < test1/input$testnumber1 | tail +2 > test1/expected$testnumber1
     12 	./gavrilov/shell < test2/input$testnumber2 | tail +2 > test2/expected$testnumber2
     13 done
     14 
     15 touch enough