Skip to content

Commit e2ed4f2

Browse files
committed
Groups for simplecov report
Add Changed group that will show the coverage for any untracked, unstaged, or staged file so developers can more easily see if that their changes are covered. Other groups added for different libraries under lib.
1 parent 7510911 commit e2ed4f2

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.simplecov

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

0 commit comments

Comments
 (0)