coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

nohup: write unit tests to improve coverage

Open sylvestre opened this issue 4 years ago • 7 comments
trafficstars

We almost don't have tests for nohup. We should have more: https://codecov.io/gh/uutils/coreutils/tree/master/src/uu/nohup/src

Should be added here: https://github.com/uutils/coreutils/blob/master/tests/by-util/test_nohup.rs

sylvestre avatar Mar 21 '21 17:03 sylvestre

The implementation gets exercised only if stdin, stdout and stderr are connected with interactive terminals. I can't think of a straightforward way to do this from tests.

I'm thinking of using pty crate to fork a child with pseudo-terminal(pty) and invoke the implementation. I haven't tried this but it looks doable.

@sylvestre Let me know if this approach is fine or if there is a better approach.

sivachandran avatar Apr 01 '21 07:04 sivachandran

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 20 '23 04:01 stale[bot]

This is the oldest beginner friendly issue. I would like to tackle it. Would this be ok? This is my first time on opensource, so I would appreciate some tips along the process, if you guys don't mind. I'll start looking at the code today to understand a little bit better.

fabracht avatar Apr 03 '23 15:04 fabracht

sure, please give it a try :)

sylvestre avatar Apr 03 '23 15:04 sylvestre