unit testing for CTRL-C sent to an application

后端 未结 2 653
庸人自扰
庸人自扰 2021-01-17 21:10

I am developing an application handling CTRL-C. I am producing a signal handler to shut-down gracefully threads and other resources.

I want to

2条回答
  •  后悔当初
    2021-01-17 21:59

    First testing the behavior when some external signal is received does not look like unit testing but like functional testing.

    Also, the way you do it also sound too complicated and is likely force some kind of synchronization and hide some behaviors.

    On the other hand I do not really have something better to suggest for this kind of tests, this is usually done by external tools in a much less controled way.

提交回复
热议问题