exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

dotest.sh (663B)


      1 #!/bin/sh
      2 
      3 # Exit, with error message (hard failure)
      4 exit_fail() {
      5     echo " FAIL: " "$@" >&2
      6     exit 1
      7 }
      8 
      9 mustach="${mustach:-../mustach}"
     10 echo "starting test"
     11 if ! valgrind --version 2> /dev/null
     12 then
     13 	$mustach "$@" > resu.last || exit_fail "ERROR! mustach command failed ($?)!"
     14 else
     15 	valgrind $mustach "$@" > resu.last 2> vg.last || exit_fail "ERROR! valgrind + mustach command failed ($?)!"
     16 	sed -i 's:^==[0-9]*== ::' vg.last
     17 	awk '/^ *total heap usage: .* allocs, .* frees,.*/{if($$4-$$6)exit(1)}' vg.last || exit_fail "ERROR! Alloc/Free issue"
     18 fi
     19 if diff -w resu.ref resu.last
     20 then
     21 	echo "result ok"
     22 else
     23 	exit_fail "ERROR! Result differs"
     24 fi
     25 echo
     26 exit 0