Criterion
Criterion copied to clipboard
How to test for `exit(EXIT_CODE)`?
Hi, I like to test for the exit code.
Below is a minimum example
#include <criterion/criterion.h>
#include <stdio.h>
void foo(int a)
{
if(a == 1) exit(1);
if(a ==2) exit(2);
return;
}
how to capture the exit code, such as 1, 2? I have try cr_fail(), cr_exit() without luck.
Thanks