combine-codecov.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. LOGDIR=$1
  3. if [ -n "$2" ]; then
  4. ODIR=$2
  5. else
  6. ODIR=.
  7. fi
  8. TMPDIR=/tmp/logs
  9. mv $LOGDIR/alt-* $TMPDIR
  10. cd $TMPDIR
  11. args=""
  12. for i in lcov-*.info-*; do
  13. args="$args -a $i"
  14. done
  15. lcov $args -o $LOGDIR/combined.info > $LOGDIR/combined-lcov.log 2>&1
  16. cat $LOGDIR/combined.info |
  17. sed "/^TN:$/{N;s/TN:\n\(SF:.*\/bits\/byteswap.h$\)/\1/};/^SF:.*\/bits\/byteswap.h$/,/^end_of_record$/d" |
  18. sed "/^TN:$/{N;s/TN:\n\(SF:.*\/common\/wpa_ctrl.c$\)/\1/};/^SF:.*\/common\/wpa_ctrl.c$/,/^end_of_record$/d" |
  19. sed "/^TN:$/{N;s/TN:\n\(SF:.*\/common\/cli.c$\)/\1/};/^SF:.*\/common\/cli.c$/,/^end_of_record$/d" |
  20. sed "/^TN:$/{N;s/TN:\n\(SF:.*\/utils\/edit.c$\)/\1/};/^SF:.*\/utils\/edit.c$/,/^end_of_record$/d" |
  21. sed "/^TN:$/{N;s/TN:\n\(SF:.*_module_tests.c$\)/\1/};/^SF:.*_module_tests.c$/,/^end_of_record$/d" |
  22. sed "/^TN:$/{N;s/TN:\n\(SF:.*\/hostapd\/hostapd_cli.c$\)/\1/};/^SF:.*\/hostapd\/hostapd_cli.c$/,/^end_of_record$/d" |
  23. sed "/^TN:$/{N;s/TN:\n\(SF:.*wpa_supplicant\/wpa_cli.c$\)/\1/};/^SF:.*wpa_supplicant\/wpa_cli.c$/,/^end_of_record$/d" > $LOGDIR/combined.info.filtered
  24. cd $LOGDIR
  25. genhtml -t "wpa_supplicant/hostapd combined for hwsim test run $(date +%s)" combined.info.filtered --output-directory $ODIR > lcov.log 2>&1
  26. rm -r /tmp/logs/alt-wpa_supplicant
  27. rm -r /tmp/logs/alt-hostapd
  28. rm -r /tmp/logs/alt-hostapd-as
  29. rm -r /tmp/logs/alt-hlr_auc_gw
  30. rm /tmp/logs/lcov-*info-*
  31. rmdir /tmp/logs