.simplecov 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # RM_INFO is set when using Rubymine. In Rubymine, starting SimpleCov is
  2. # controlled by running with coverage, so don't explicitly start coverage (and
  3. # therefore generate a report) when in Rubymine. This _will_ generate a report
  4. # whenever `rake spec` is run.
  5. unless ENV['RM_INFO']
  6. SimpleCov.start
  7. end
  8. SimpleCov.configure do
  9. # ignore this file
  10. add_filter '.simplecov'
  11. #
  12. # Changed Files in Git Group
  13. # @see http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only
  14. #
  15. untracked = `git ls-files --exclude-standard --others`
  16. unstaged = `git diff --name-only`
  17. staged = `git diff --name-only --cached`
  18. all = untracked + unstaged + staged
  19. changed_filenames = all.split("\n")
  20. add_group 'Changed' do |source_file|
  21. changed_filenames.detect { |changed_filename|
  22. source_file.filename.end_with?(changed_filename)
  23. }
  24. end
  25. #
  26. # Framework (msf) related groups
  27. #
  28. add_group 'Metasploit Framework', 'lib/msf'
  29. add_group 'Metasploit Framework (Base)', 'lib/msf/base'
  30. add_group 'Metasploit Framework (Core)', 'lib/msf/core'
  31. #
  32. # Other library groups
  33. #
  34. add_group 'Metasm', 'lib/metasm'
  35. add_group 'PacketFu', 'lib/packetfu'
  36. add_group 'Rex', 'lib/rex'
  37. add_group 'RKelly', 'lib/rkelly'
  38. add_group 'Ruby Mysql', 'lib/rbmysql'
  39. add_group 'Ruby Postgres', 'lib/postgres'
  40. add_group 'SNMP', 'lib/snmp'
  41. add_group 'Zip', 'lib/zip'
  42. #
  43. # Specs are reported on to ensure that all examples are being run and all
  44. # lets, befores, afters, etc are being used.
  45. #
  46. add_group 'Specs', 'spec'
  47. end