September 09, 2017 Unit-tests with stderr / stdout | ||||
---|---|---|---|---|
| ||||
Hi, As a system administrator I often have some small scripts/ programs that consume input and produce output for other system utilities. Something like `my_foo_program | awk ... | other_program`. As the tools write to STDOUT/STDERR, I haven't found a way to write unit tests for them. Should I write library instead? Is there any framework to write (smoke) tests that supports standard output devices? Thanks for your reading. |
September 09, 2017 Re: Unit-tests with stderr / stdout | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ky-Anh Huynh | On Saturday, 9 September 2017 at 03:37:58 UTC, Ky-Anh Huynh wrote:
> Hi,
>
> As a system administrator I often have some small scripts/ programs that consume input and produce output for other system utilities. Something like `my_foo_program | awk ... | other_program`. As the tools write to STDOUT/STDERR, I haven't found a way to write unit tests for them. Should I write library instead? Is there any framework to write (smoke) tests that supports standard output devices?
>
> Thanks for your reading.
So far I have refactored my code to use some public libraries. This allows me to write some unit tests. This requires a lot more work :)
Sorry for the noise.
|
Copyright © 1999-2021 by the D Language Foundation