Skip to content

Commit

Permalink
🐛 Fixed shell out handling exposed by Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarlesky committed May 12, 2024
1 parent 0ef0fa7 commit 0637570
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,28 @@ jobs:
# gem install --local ceedling-*.gem

# # Run Temp Sensor
# - name: Run Tests On Temp Sensor Project
# - name: Run Tests on temp_sensor Project
# run: |
# cd examples/temp_sensor
# ceedling module:create[someNewModule] module:destroy[someNewModule] test:all
# cd ../..

# # Run FFF Plugin Tests
# - name: Run Tests On FFF Plugin
# - name: Run Tests on FFF Plugin
# run: |
# cd plugins/fff
# rake
# cd ../..

# # Run Module Generator Plugin Tests
# - name: Run Tests On Module Generator Plugin
# - name: Run Tests on Module Generator Plugin
# run: |
# cd plugins/module_generator
# rake
# cd ../..

# # Run Dependencies Plugin Tests
# - name: Run Tests On Dependency Plugin
# - name: Run Tests on Dependency Plugin
# run: |
# cd plugins/dependencies
# rake
Expand Down Expand Up @@ -177,28 +177,28 @@ jobs:
gem install --local ceedling-*.gem
# Run Temp Sensor
- name: Run Tests On Temp Sensor Project
- name: Run Tests on temp_sensor Project
run: |
cd examples/temp_sensor
ceedling module:create[someNewModule] module:destroy[someNewModule] test:all
cd ../..
# Run FFF Plugin Tests
- name: Run Tests On FFF Plugin
- name: Run Tests on FFF Plugin
run: |
cd plugins/fff
rake
cd ../..
# Run Module Generator Plugin Tests
- name: Run Tests On Module Generator Plugin
- name: Run Tests on Module Generator Plugin
run: |
cd plugins/module_generator
rake
cd ../..
# Run Dependencies Plugin Tests
- name: Run Tests On Dependency Plugin
- name: Run Tests on Dependency Plugin
run: |
cd plugins/dependencies
rake
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GEM
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
Expand All @@ -27,6 +27,7 @@ GEM

PLATFORMS
ruby
x64-mingw-ucrt
x64-mingw32
x86_64-darwin-22
x86_64-linux
Expand Down
6 changes: 4 additions & 2 deletions lib/ceedling/system_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,19 @@ def shell_capture3(command:, boom:false)
# Parts of Process::Status's behavior is similar to an integer exit code in
# some operations but not all.
exit_code = 0
stdout, stderr = ''
status = nil
begin
# Run the command but absorb any exceptions and capture error info instead
stdout, stderr, status = Open3.capture3( command )
rescue => err
stderr = err
stderr = err.to_s
exit_code = -1
end

# If boom, then capture the actual exit code, otherwise leave it as zero
# as though execution succeeded
exit_code = status.exitstatus.freeze if boom
exit_code = status.exitstatus.freeze if boom and !status.nil?

# (Re)set the system exit code
$exit_code = exit_code
Expand Down

0 comments on commit 0637570

Please sign in to comment.