Skip to content

Commit

Permalink
enable coverage report for type shellscript
Browse files Browse the repository at this point in the history
With `bashcov` and the following configuration for `simplecov` can you get coverage reports for you shell scripts.

```ruby
# gem install simplecov-lcov simplecov-console
require 'simplecov-lcov'
require 'simplecov-console'

SimpleCov.start do
    add_filter %r{^/.git}
end

# Monkeypatch
# fortissimo1997/simplecov-lcov#25
if ! SimpleCov.respond_to?(:branch_coverage?)
    module SimpleCov
        def self.branch_coverage?
            false
        end
    end
end
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov::Formatter::LcovFormatter.config do |c|
    c.output_directory = 'coverage' # default: "coverage/lcov"
    c.lcov_file_name = 'lcov.info'

end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
    SimpleCov::Formatter::LcovFormatter,
    SimpleCov::Formatter::HTMLFormatter,
    SimpleCov::Formatter::Console
])
```
  • Loading branch information
lnxbil authored Apr 20, 2022
1 parent 4d4eb6f commit a424a93
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"onLanguage:rust",
"onLanguage:typescript",
"onLanguage:typescriptreact",
"onLanguage:shellscript",
"onLanguage:vb"
],
"main": "./out/src/extension.js",
Expand Down

0 comments on commit a424a93

Please sign in to comment.