bashcov 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/CHANGELOG.md +6 -1
- data/README.md +9 -6
- data/bin/bashcov +1 -1
- data/lib/bashcov/lexer.rb +1 -1
- data/lib/bashcov/version.rb +1 -1
- data/lib/bashcov.rb +2 -2
- data/spec/bashcov/runner_spec.rb +2 -4
- data/spec/support/test_app.rb +1 -1
- data/spec/test_app/scripts/multiline.sh +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51672b26914fff5fc95fbf6c42bddbfb201e8132
|
4
|
+
data.tar.gz: ff4eb7d2df73d8817f4780f19fa77872f5670679
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eea7d38ab1ef4ef37df415ff13957fdea5f1a1eb35b13d4de416cca6107177b9dd6f3ca2ac2c24cddab776fec3c1f5905dac59a989b8fe634308f81498d8e20
|
7
|
+
data.tar.gz: 7c0eb4b5974220ee6bd1ef18b538f79c3af2dbf3993c675425fd1e9734b3dacbe3bfe76bd0aad8f7dd16df6136ea841c291433f96395efb552dcd18adae8cb4f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
-
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.0.
|
1
|
+
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.0.1...master))
|
2
2
|
|
3
3
|
* TBD
|
4
4
|
|
5
|
+
## v1.0.1, 2013-03-21 ([changes](https://github.com/infertux/bashcov/compare/v1.0.0...v1.0.1))
|
6
|
+
|
7
|
+
* [BUGFIX] Allow to add SimpleCov filters.
|
8
|
+
* [BUGFIX] Lines containing only `elif` should be ignored.
|
9
|
+
|
5
10
|
## v1.0.0, 2013-03-16 ([changes](https://github.com/infertux/bashcov/compare/v0.0.9...v1.0.0))
|
6
11
|
|
7
12
|
* First stable release. Enjoy!
|
data/README.md
CHANGED
@@ -21,7 +21,10 @@
|
|
21
21
|
[Bashcov]: https://github.com/infertux/bashcov
|
22
22
|
[SimpleCov]: https://github.com/colszowka/simplecov "Bashcov is backed by SimpleCov to generate awesome coverage report"
|
23
23
|
|
24
|
-
You should check out
|
24
|
+
You should check out these coverage examples - it's worth a thousand words:
|
25
|
+
|
26
|
+
- [Test app demo](http://infertux.github.com/bashcov/test_app/ "Coverage for the bundled test application")
|
27
|
+
- [RVM demo](http://infertux.github.com/bashcov/rvm/ "Coverage for RVM")
|
25
28
|
|
26
29
|
## Installation
|
27
30
|
|
@@ -29,13 +32,13 @@ You should check out the **[demo](http://infertux.github.com/bashcov/test_app/)*
|
|
29
32
|
|
30
33
|
## Usage
|
31
34
|
|
32
|
-
|
35
|
+
`$ bashcov --help` prints all available options.
|
33
36
|
Here are some examples:
|
34
37
|
|
35
|
-
bashcov ./script.sh
|
36
|
-
bashcov --skip-uncovered ./script.sh
|
37
|
-
bashcov -- ./script.sh --some --flags
|
38
|
-
bashcov --skip-uncovered -- ./script.sh --some --flags
|
38
|
+
$ bashcov ./script.sh
|
39
|
+
$ bashcov --skip-uncovered ./script.sh
|
40
|
+
$ bashcov -- ./script.sh --some --flags
|
41
|
+
$ bashcov --skip-uncovered -- ./script.sh --some --flags
|
39
42
|
|
40
43
|
`script.sh` can be a mere Bash script or typically your CI script.
|
41
44
|
Bashcov will keep track of all executed scripts.
|
data/bin/bashcov
CHANGED
data/lib/bashcov/lexer.rb
CHANGED
@@ -9,7 +9,7 @@ module Bashcov
|
|
9
9
|
IGNORE_END_WITH = %w|(|
|
10
10
|
|
11
11
|
# Lines containing only one of these keywords are irrelevant for coverage
|
12
|
-
IGNORE_IS = %w|esac if then fi while do done
|
12
|
+
IGNORE_IS = %w|esac if then else elif fi while do done { } ;;|
|
13
13
|
|
14
14
|
# @param [String] filename File to analyze
|
15
15
|
# @param [Hash] coverage Coverage with executed lines marked
|
data/lib/bashcov/version.rb
CHANGED
data/lib/bashcov.rb
CHANGED
@@ -14,9 +14,9 @@ module Bashcov
|
|
14
14
|
# @return [OpenStruct] Bashcov settings
|
15
15
|
attr_reader :options
|
16
16
|
|
17
|
-
# @return [String] The project's root directory
|
17
|
+
# @return [String] The project's root directory
|
18
18
|
def root_directory
|
19
|
-
@root_directory ||=
|
19
|
+
@root_directory ||= Dir.pwd
|
20
20
|
end
|
21
21
|
|
22
22
|
# Sets default options overriding any existing ones.
|
data/spec/bashcov/runner_spec.rb
CHANGED
@@ -4,10 +4,8 @@ require 'benchmark'
|
|
4
4
|
describe Bashcov::Runner do
|
5
5
|
let(:runner) { Bashcov::Runner.new test_suite }
|
6
6
|
|
7
|
-
before do
|
8
|
-
|
9
|
-
# so we need to stub it
|
10
|
-
Bashcov.options.stub(:command).and_return(test_suite)
|
7
|
+
before :all do
|
8
|
+
Dir.chdir File.dirname(test_suite)
|
11
9
|
end
|
12
10
|
|
13
11
|
describe "#run" do
|
data/spec/support/test_app.rb
CHANGED
@@ -23,7 +23,7 @@ def expected_coverage
|
|
23
23
|
"#{test_app}/scripts/source.sh" => [nil, nil, 1, nil, 2],
|
24
24
|
"#{test_app}/scripts/sourced.txt" => [nil, nil, 1],
|
25
25
|
"#{test_app}/scripts/unicode.sh" => [nil, nil, nil, 1],
|
26
|
-
"#{test_app}/scripts/multiline.sh" => [nil, nil, 1,
|
26
|
+
"#{test_app}/scripts/multiline.sh" => [nil, nil, nil, 1, nil, 0, nil, 1, nil, 1, nil, 0, nil, nil, 1, 2, 1, 1, 0, nil, nil, 0, 1, 2],
|
27
27
|
"#{test_app}/scripts/executable" => [nil, nil, 1],
|
28
28
|
"#{test_app}/test_suite.sh" => [nil, nil, 2, nil, 1]
|
29
29
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bashcov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cédric Félizard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|