Skip to content

Commit 808077a

Browse files
Add SimpleCov and test coverage reporting (#654)
Closes #629 Signed-off-by: Shehroz Kashif <131602772+Shehrozkashif@users.noreply.github.com>
1 parent 407adae commit 808077a

File tree

10 files changed

+34
-0
lines changed

10 files changed

+34
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ __pycache__/
2323
*.bak
2424
*.log
2525
sorbet
26+
coverage

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ group :development do
3636
gem "spoom"
3737
gem "tapioca", require: false
3838
end
39+
40+
group :development, :test do
41+
gem "minitest"
42+
gem "simplecov"
43+
end

Gemfile.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ GEM
6464
irb (~> 1.10)
6565
reline (>= 0.3.8)
6666
diff-lcs (1.6.0)
67+
docile (1.4.1)
6768
drb (2.2.1)
6869
erubi (1.13.1)
6970
hana (1.3.7)
@@ -176,6 +177,12 @@ GEM
176177
ruby-rc4 (0.1.5)
177178
rubyzip (2.4.1)
178179
securerandom (0.4.1)
180+
simplecov (0.22.0)
181+
docile (~> 1.1)
182+
simplecov-html (~> 0.11)
183+
simplecov_json_formatter (~> 0.1)
184+
simplecov-html (0.13.1)
185+
simplecov_json_formatter (0.1.4)
179186
simpleidn (0.2.3)
180187
solargraph (0.52.0)
181188
backport (~> 1.2)
@@ -267,6 +274,7 @@ DEPENDENCIES
267274
ruby-prof
268275
ruby-prof-flamegraph!
269276
ruby-progressbar (~> 1.13)
277+
simplecov
270278
solargraph
271279
sorbet
272280
sorbet-runtime

lib/idl/tests/test_expressions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require_relative '../../test/test_helper'
12
require "minitest/autorun"
23

34
$root ||= (Pathname.new(__FILE__) / ".." / ".." / ".." / "..").realpath

lib/idl/tests/test_functions.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require_relative '../../test/test_helper'
12
require "minitest/autorun"
23

34
$root ||= (Pathname.new(__FILE__) / ".." / ".." / ".." / "..").realpath

lib/idl/tests/test_lexer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require_relative '../../test/test_helper'
12
require "minitest/autorun"
23

34
$root ||= (Pathname.new(__FILE__) / ".." / ".." / ".." / "..").realpath

lib/idl/tests/test_variables.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require_relative '../../test/test_helper'
12
require "minitest/autorun"
23

34
$root ||= (Pathname.new(__FILE__) / ".." / ".." / ".." / "..").realpath

lib/test/test_backend_helpers.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require_relative 'test_helper'
34
require "English"
45
require "minitest/autorun"
56
require "backend_helpers"

lib/test/test_helper.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require 'simplecov'
2+
3+
SimpleCov.start do
4+
enable_coverage :branch
5+
6+
add_group 'Arch Obj Models', 'arch_obj_models'
7+
add_group 'IDL Core', 'idl'
8+
add_group 'IDL Regression Tests', 'idl/tests'
9+
add_group 'Top-level Tests', 'test'
10+
end
11+
12+
puts "[SimpleCov] Coverage started."
13+
14+
require 'minitest/autorun'

lib/test/test_yaml_loader.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require_relative 'test_helper'
34
require "English"
45
require "fileutils"
56
require "minitest/autorun"

0 commit comments

Comments
 (0)