rtomayko / posix-spawn

Ruby process spawning library
Other
519 stars 52 forks source link

Misuse of shell builtins (?) #22

Closed blambeau closed 12 years ago

blambeau commented 12 years ago

Hi,

All tests relying on exec seem failing under standard *nix config (cfr. http://travis-ci.org/#!/blambeau/posix-spawn) Typical example:

pid = _spawn('exec 2>/dev/null 101>&1 102>&2 || exit 1', :out => :close, :err => :close)
assert_process_exit_status pid, 1

which results in an exit status of 2 (misuse of shell builtins), not 1. I must confess that I'm not sure to understand what the test above is supposed to test (that out cannot be redirected? or err? or both?).

Any hint on this?

tmm1 commented 12 years ago

This is probably related to #6

blambeau commented 12 years ago

Ooops sorry. I thought I've read all existing issues before submitting this one, something has failed in my process. I obvisouly close this one. Thanks

tmm1 commented 12 years ago

Does it work if you install bash instead of dash?

blambeau commented 12 years ago

almost:


# Running tests:

.yes: standard output: Broken pipe
yes: write error
...............................................................................................hiya
F........................................

Finished tests in 0.969090s, 141.3697 tests/s, 463.3212 assertions/s.

  1) Failure:
test_spawn_close_invalid_fd_raises_exception(PosixSpawnTest) [/home/blambeau/work/devel/posix-spawn/test/test_spawn.rb:119]:
<127> expected but was
<0>.

137 tests, 449 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [/home/blambeau/.rvm/rubies/ruby-1.9.3-p0/b...]