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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e4f73a217009bf88f987dba5058c178ae1c9971
4
- data.tar.gz: 2877c76c643179f05f0a453df690e11879f273b2
3
+ metadata.gz: a3fa863e6848203b79a712e22697741dbe3f40e8
4
+ data.tar.gz: 5a145fc486a1d5ddf0bc09db6d0e0cba65e82bb3
5
5
  SHA512:
6
- metadata.gz: 77cd74423bb960f8afb99fa4ce7fd36f9c7751ae352dc23f88a1de077a07a9de29fbaa0dae1a5500d673f271c33bc3e10481642dbde24e7e174a3f967cfe14d4
7
- data.tar.gz: ea991103cb285f83f74931c5a7ed1c867a72e86e4c6a8f16ec92506017e4053bd9666e4c12e9234d2b24ab5f1c0e43dee3c9d477223378d76299b6b41efc58cd
6
+ metadata.gz: 3d6dec21c6e9619988ebbc8b811a87fbbcdbc5b73d07405f7ba50e281e81ea8371e45bca945425acaf433fa4eba673f7f68fd84bb08cba7c546e6d6590952854
7
+ data.tar.gz: 34257113bfc309bb1c7e374c2f23170685c0f5ca59c6b718354a7d0f61dca898ed3979f008c199c35b921fe8a12c804d5ef19aeeacf4b3e9d45df2c172c0d12c
data/.rubocop.yml CHANGED
@@ -22,3 +22,6 @@ Style/SpecialGlobalVars:
22
22
 
23
23
  Style/StringLiterals:
24
24
  EnforcedStyle: double_quotes
25
+
26
+ Style/TrailingComma:
27
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,7 +1,11 @@
1
- ## Unreleased ([changes](https://github.com/infertux/bashcov/compare/v1.2.0...master))
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
@@ -14,11 +14,11 @@ module Bashcov
14
14
 
15
15
  @xtrace = Xtrace.new
16
16
  fd = @xtrace.file_descriptor
17
- @command = "BASH_XTRACEFD=#{fd} PS4='#{Xtrace::PS4}' #{@command}"
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
@@ -1,4 +1,4 @@
1
1
  # :nodoc:
2
2
  module Bashcov
3
- VERSION = "1.2.0".freeze
3
+ VERSION = "1.2.1".freeze
4
4
  end
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
 
@@ -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}/test_suite.sh" => [nil, nil, 2, nil, 1]
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
 
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ exit 21
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.0
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-04 00:00:00.000000000 Z
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