Home | History | Annotate | Download | only in filters
      1 #!/bin/bash
      2 
      3 failed=0
      4 for file in $(find $1 -type f -iname 'test*'); do
      5   case $file in
      6     *testFilters) continue; ;;
      7     *Expected) continue; ;;
      8     *Trace) continue; ;;
      9     *.html) continue; ;;
     10   esac
     11 
     12   echo "Running test for $file"
     13 
     14 #  create_test_dmtrace $file tmp.trace
     15   dmtracedump -f testFilters -h "$file"Trace > tmp.html 2> /dev/null
     16 
     17   output=`diff tmp.html "$file"Expected 2>&1`
     18   if [ ${#output} -eq 0 ]
     19   then
     20     echo "  OK"
     21   else
     22     echo " Test failed: $output"
     23     failed=`expr $failed + 1`
     24   fi
     25 
     26 done
     27 
     28 rm tmp.trace
     29 rm tmp.html
     30 
     31 if [ $failed -gt 0 ]
     32 then
     33   echo "$failed test(s) failed"
     34 else
     35   echo "All tests passed successfully"
     36 fi
     37