check_coverage_functions.sh 822 B

123456789101112131415161718192021
  1. # get all the functions
  2. all_functions=$( xrnlib-cli --example | sed 's/#.*$//; s/xrnlib-cli --example //; /^$/d' | sort | grep -v print-lib-info )
  3. # get all the functions called
  4. all_functions_called=$(ls | grep -v run_parser_tests.sh | grep -v check_coverage_functions.sh | xargs cat | \
  5. awk '/--/{print $0}' | grep -v conf | grep -v silent | grep -v print-lib-info | sed 's/^.*--/--/g; s/ .*$//' | sort | uniq | sed 's/--//')
  6. unique_to_string=$(echo "$all_functions $all_functions_called" | tr ' ' '\n' | sort | uniq -u | tr -s '\n' ' ')
  7. if [ -z "$unique_to_string" ]; then
  8. echo "correct"
  9. else
  10. echo "all_functions list: " ; echo $all_functions ; echo ""
  11. echo "all_called_functions list: " ; echo $all_functions_called ; echo ""
  12. echo "fail list: " ; echo $unique_to_string
  13. fi