lundi 8 août 2016

Unit testing kill command

So I am trying to do something bad and dirty ;)

I want to call kill(0, SIGKILL) in my check unittest to kill child processes I launched with this test.

ck_assert_int_eq(magic(13), 13); //<- success, but I cannot stop magic now

if I do

ck_assert_int_eq(kill(0, SIGKILL), 0); 

I get "test: (after this point) Received signal 9 (Killed)"

Are there ways around it? kill(0, SIGKILL) also done in the actual code, so I think if I try to call destruction function from my test, I am going end with the same error.

Aucun commentaire:

Enregistrer un commentaire