33 Commits

Author SHA1 Message Date
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
IbrahimSaad
399616b408
link tests targets with thread library (#79) 2022-06-11 11:02:05 +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
Arun M
dafa7dd36b string comparison issue on win32 #55 2020-06-13 13:06:00 +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 Muralidharan
871577770a
Revert "WIP: Add windows compatibility (#30)" (#31)
This reverts commit 5d92f4849276aa313dc1ba56c1556f4cca27fc7f.
2019-05-02 12:24:40 +05:30
xoviat
5d92f48492 WIP: Add windows compatibility (#30)
* add package files

* add windows compat to subprocess.hpp

* add test modifications

* repair test_read_all
2019-05-02 12:02:17 +05:30
Arun M
e6cb89cb6e readme minor missing content #22 2019-01-03 22:06:20 +05:30
mohamedAlaaK
d74481c564 fixed a bug in util::read_all() function and added a test for it (#23) 2019-01-03 21:59:49 +05:30
Arun M
ced3d53e3a I can send() but I have no way of closing the input channel #21 2018-12-31 17:41:24 +05:30
Arun M
a90174cf5c is throwing errors #16 2018-09-30 10:10:40 +05:30
Arun M
05c76a5311 Reading from a pipe is messed up #14 2018-04-16 10:50:46 +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
Arun M
ca74a559c5 Fix all the compilation warnings #9 2018-03-01 16:10:05 +05:30
arunmu
a23c1033df Fixed 2 issues:
1. When more than 2 streams are piped, we use threads to read/write data
parallely. In this scenariod read_atmost_n API was being used instead of
read_all.
2. Another issue with check_output argument validation fixed.
2016-03-21 20:25:37 +05:30
arunmu
de49e349dc some test changes 2016-03-19 23:49:37 +05:30
arunmu
5e1a9c9088 Fixed poll return status 2016-03-19 18:18:47 +05:30
arunmu
9b2e9229a5 Added documentation 2016-03-19 17:40:39 +05:30
arunmu
9762f241ae quite a few changes and added functionalities and tests 2016-03-19 00:32:58 +05:30
arunmu
cccc08e7c5 Uncommented previously commented tests 2016-03-18 17:07:52 +05:30
arunmu
aab30d19bf Major issue resolved execv args was not terminated with nullptr 2016-03-18 17:06:44 +05:30
arunmu
f409d50c8d overload stream arguments for file pointer and new pipeline test case 2016-03-18 15:46:53 +05:30
arunmu
6a9f0aab51 added more tests 2016-03-17 21:19:36 +05:30
arunmu
fd9efecf05 New test case for cat and env 2016-03-17 15:23:11 +05:30
arunmu
b5a3d3fb47 Add cat test case 2016-03-17 12:56:40 +05:30
arunmu
6a81526254 Refactored Buffer 2016-03-16 14:14:11 +05:30
arunmu
a96466ca18 Communicate test case works in the last commit 2016-03-16 12:16:21 +05:30
arunmu
18686a79ed communicate implemented - test case not working though 2016-03-16 12:12:46 +05:30
arunmu
7260f1a358 New test file 2016-03-15 20:23:38 +05:30
arunmu
fc24e168da First commit of subprocess-cpp 2016-03-15 11:35:07 +05:30