bashcov 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +5 -1
- data/bin/bashcov +3 -1
- data/lib/bashcov/runner.rb +3 -3
- data/lib/bashcov/version.rb +1 -1
- data/spec/bashcov_spec.rb +5 -0
- data/spec/support/test_app.rb +2 -1
- data/spec/test_app/scripts/exit_non_zero.sh +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3fa863e6848203b79a712e22697741dbe3f40e8
|
4
|
+
data.tar.gz: 5a145fc486a1d5ddf0bc09db6d0e0cba65e82bb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d6dec21c6e9619988ebbc8b811a87fbbcdbc5b73d07405f7ba50e281e81ea8371e45bca945425acaf433fa4eba673f7f68fd84bb08cba7c546e6d6590952854
|
7
|
+
data.tar.gz: 34257113bfc309bb1c7e374c2f23170685c0f5ca59c6b718354a7d0f61dca898ed3979f008c199c35b921fe8a12c804d5ef19aeeacf4b3e9d45df2c172c0d12c
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.2.
|
1
|
+
## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.2.1...master))
|
2
2
|
|
3
3
|
* TBD
|
4
4
|
|
5
|
+
## v1.2.1, 2015-05-05 ([changes](https://github.com/infertux/bashcov/compare/v1.2.0...v1.2.1))
|
6
|
+
|
7
|
+
* [BUGFIX] Preserve original exit status when exiting Bashcov
|
8
|
+
|
5
9
|
## v1.2.0, 2015-05-04 ([changes](https://github.com/infertux/bashcov/compare/v1.1.0...v1.2.0))
|
6
10
|
|
7
11
|
* [FEATURE] Enforce coherent coding style with Rubocop
|
data/bin/bashcov
CHANGED
@@ -8,7 +8,7 @@ require "bashcov"
|
|
8
8
|
Bashcov.parse_options! ARGV
|
9
9
|
|
10
10
|
runner = Bashcov::Runner.new Bashcov.options.command
|
11
|
-
runner.run
|
11
|
+
status = runner.run
|
12
12
|
coverage = runner.result
|
13
13
|
|
14
14
|
require "simplecov"
|
@@ -16,3 +16,5 @@ require "simplecov"
|
|
16
16
|
SimpleCov.command_name Bashcov.name
|
17
17
|
SimpleCov.root Bashcov.root_directory
|
18
18
|
SimpleCov::Result.new(coverage).format!
|
19
|
+
|
20
|
+
exit status.exitstatus
|
data/lib/bashcov/runner.rb
CHANGED
@@ -14,11 +14,11 @@ module Bashcov
|
|
14
14
|
|
15
15
|
@xtrace = Xtrace.new
|
16
16
|
fd = @xtrace.file_descriptor
|
17
|
-
|
18
|
-
options = { :in => :in, fd => fd } # bind fds to the child process
|
17
|
+
options = { :in => :in, fd => fd } # bind FDs to the child process
|
19
18
|
options.merge!(out: "/dev/null", err: "/dev/null") if Bashcov.options.mute
|
19
|
+
env = { "BASH_XTRACEFD" => fd.to_s, "PS4" => Xtrace::PS4 }
|
20
20
|
|
21
|
-
command_pid = Process.spawn @command, options # spawn the command
|
21
|
+
command_pid = Process.spawn env, @command, options # spawn the command
|
22
22
|
xtrace_thread = Thread.new { @xtrace.read } # start processing the xtrace output
|
23
23
|
|
24
24
|
Process.wait command_pid
|
data/lib/bashcov/version.rb
CHANGED
data/spec/bashcov_spec.rb
CHANGED
@@ -15,6 +15,11 @@ shared_examples "a fatal error" do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe Bashcov do
|
18
|
+
it "preserves the exit status" do
|
19
|
+
system("./bin/bashcov ./spec/test_app/scripts/exit_non_zero.sh")
|
20
|
+
expect($?.exitstatus).not_to eq(0)
|
21
|
+
end
|
22
|
+
|
18
23
|
describe ".parse_options!" do
|
19
24
|
before { @args = [] }
|
20
25
|
|
data/spec/support/test_app.rb
CHANGED
@@ -25,7 +25,8 @@ def expected_coverage
|
|
25
25
|
"#{test_app}/scripts/unicode.sh" => [nil, nil, nil, 1],
|
26
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
|
-
"#{test_app}/
|
28
|
+
"#{test_app}/scripts/exit_non_zero.sh" => [nil, nil, 1],
|
29
|
+
"#{test_app}/test_suite.sh" => [nil, nil, 2, nil, 1],
|
29
30
|
}
|
30
31
|
end
|
31
32
|
|
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.2.
|
4
|
+
version: 1.2.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: 2015-05-
|
11
|
+
date: 2015-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- spec/test_app/scripts/case.sh
|
177
177
|
- spec/test_app/scripts/delete.sh
|
178
178
|
- spec/test_app/scripts/executable
|
179
|
+
- spec/test_app/scripts/exit_non_zero.sh
|
179
180
|
- spec/test_app/scripts/function.sh
|
180
181
|
- spec/test_app/scripts/long_line.sh
|
181
182
|
- spec/test_app/scripts/multiline.sh
|
@@ -224,6 +225,7 @@ test_files:
|
|
224
225
|
- spec/test_app/scripts/case.sh
|
225
226
|
- spec/test_app/scripts/delete.sh
|
226
227
|
- spec/test_app/scripts/executable
|
228
|
+
- spec/test_app/scripts/exit_non_zero.sh
|
227
229
|
- spec/test_app/scripts/function.sh
|
228
230
|
- spec/test_app/scripts/long_line.sh
|
229
231
|
- spec/test_app/scripts/multiline.sh
|