9 Commits

Author SHA1 Message Date
Haowen Liu
ab2d49a445
Update include paths in tests 2025-05-04 10:47:43 -04:00
Hennadii Stepanov
06858e5fd7
test: Adjust test_ret_code for Windows and re-enable it (#97) 2023-12-03 18:10:05 +05:30
xoviat
64f4dfc2e5
remove changes to quote_argument and bring back ci for all platforms (#91)
* revert channges to quote argument

* ci: add cmake draft

* ci: enable suprocess tests

* cleanup some warnings

* ci: disable nonworking windows tests

* ci: set timeout

* ci: disable nonworking tests on windows

* ci: remove travis

---------

Co-authored-by: xoviat <xoviat@users.noreply.github.com>
2023-08-28 09:54:20 +05:30
Jan Christoph Uhde
d9ed0d606f
chore: improve CMake files (#85) 2023-03-21 08:39:25 +05:30
Jake Zimmerman
2ef9f168d3
Add retcode to CalledProcessError (#81)
It's useful to be able to know the exit code of the process when it
fails with a non-zero exit code.

To get this to work, I had to fix a bug in the implementation of
check_output. Previously, check_output would call both `p.communicate()`
and `p.poll()`. The former has the effect of waiting for EOF on the
input and then waiting for the child to exit, reaping it with
`waitpid(2)`. Unfortunately, `p.poll()` was hoping to be able to also
use `waitpid(2)` to retrieve the exit code of the process. But since the
child had already been reaped, the given pid no longer existed, and thus
`waitpid(2)` would return `ECHILD`.

Luckily the call to `p.poll()` is unnecessary, as the process already
provides `p.retcode()` for retrieving the exit code.
2022-05-29 09:48:20 +05:30
xoviat
9c624ce4e3 Enable basic windows support (#33)
* windows: fix implementation error
- repair configure_pipe
- allow vector initialization
- add draft destructor
- close pipes correctly

* windows: add some test compatibility

* windows: update readme

* windows: add vector args to check_output
2020-01-18 20:01:03 +05:30
xoviat
f6799fcc34 WIP: add windows compatibility (#32)
* windows: add util functions

* windows: add cmake files

* windows: add travis.yml

* windows: address compatibility
- set cxx standard
- conditionally exclude codecvt

* windows: improve test coverage

* windows: improve test coverage

* windows: consolidate tests

* windows: disable failing test

* windows: modify read_atmost_n to use file object

* windows: modify read_all to use file object

* windows: update read_all test to use new api

* windows: implement main subprocess logic

* windows: add macro names

* windows: setup comm channels

* windows: compatibility fixes
2019-05-09 22:02:58 +05:30
Arun M
b5e3da1cf7 Cannot access process retcode after #13 2018-04-14 22:51:06 +05:30
okaymaged
7534a9cddb Don't waitpid on SIGCHLD, which lost the retcode (#11)
* Don't waitpid on SIGCHLD, which lost the retcode

* Adding test
2018-03-02 20:28:24 +05:30