|
| 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 | + |
| 9 | +SimpleCov.configure do |
| 10 | + # ignore this file |
| 11 | + add_filter '.simplecov' |
| 12 | + |
| 13 | + # |
| 14 | + # Changed Files in Git Group |
| 15 | + # @see http://fredwu.me/post/35625566267/simplecov-test-coverage-for-changed-files-only |
| 16 | + # |
| 17 | + |
| 18 | + untracked = `git ls-files --exclude-standard --others` |
| 19 | + unstaged = `git diff --name-only` |
| 20 | + staged = `git diff --name-only --cached` |
| 21 | + all = untracked + unstaged + staged |
| 22 | + changed_filenames = all.split("\n") |
| 23 | + |
| 24 | + add_group 'Changed' do |source_file| |
| 25 | + changed_filenames.detect { |changed_filename| |
| 26 | + source_file.filename.end_with?(changed_filename) |
| 27 | + } |
| 28 | + end |
| 29 | + |
| 30 | + # |
| 31 | + # Framework (msf) related groups |
| 32 | + # |
| 33 | + |
| 34 | + add_group 'Metasploit Framework', 'lib/msf' |
| 35 | + add_group 'Metasploit Framework (Base)', 'lib/msf/base' |
| 36 | + add_group 'Metasploit Framework (Core)', 'lib/msf/core' |
| 37 | + |
| 38 | + # |
| 39 | + # Other library groups |
| 40 | + # |
| 41 | + |
| 42 | + add_group 'Fastlib', 'lib/fastlib' |
| 43 | + add_group 'Metasm', 'lib/metasm' |
| 44 | + add_group 'PacketFu', 'lib/packetfu' |
| 45 | + add_group 'Rex', 'lib/rex' |
| 46 | + add_group 'RKelly', 'lib/rkelly' |
| 47 | + add_group 'Ruby Mysql', 'lib/rbmysql' |
| 48 | + add_group 'Ruby Postgres', 'lib/postgres' |
| 49 | + add_group 'SNMP', 'lib/snmp' |
| 50 | + add_group 'Zip', 'lib/zip' |
| 51 | + |
| 52 | + # |
| 53 | + # Specs are reported on to ensure that all examples are being run and all |
| 54 | + # lets, befores, afters, etc are being used. |
| 55 | + # |
| 56 | + |
| 57 | + add_group 'Specs', 'spec' |
| 58 | +end |
0 commit comments