uncovered 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash -eur
  2. # ex:ts=4:sw=4:sts=4:et
  3. # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
  4. #
  5. # Find python modules uncovered by oe-seltest
  6. #
  7. # Copyright (c) 2016, Intel Corporation
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License version 2 as
  11. # published by the Free Software Foundation.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License along
  19. # with this program; if not, write to the Free Software Foundation, Inc.,
  20. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. #
  22. # Author: Ed Bartosh <ed.bartosh@linux.intel.com>
  23. #
  24. if [ ! "$#" -eq 1 -o -t 0 ] ; then
  25. echo 'Usage: coverage report | ./scripts/contrib/uncovered <dir>' 1>&2
  26. exit 1
  27. fi
  28. path=$(readlink -ev $1)
  29. if [ ! -d "$path" ] ; then
  30. echo "directory $1 doesn't exist" 1>&2
  31. exit 1
  32. fi
  33. diff -u <(grep "$path" | grep -v '0%$' | cut -f1 -d: | sort) \
  34. <(find $path | xargs file | grep 'Python script' | cut -f1 -d:| sort) | \
  35. grep "^+$path" | cut -c2-