Setting ulimit in a test?

Hello everybody,

I need to artificially limit memory for a test to simulate an out of memory error (perhaps by setting ulimit). Is there a CTest way of doing that?

–Sam

CTest doesn’t have a native way of invoking ulimit. My recommendation would be to wrap your test in a shell script that calls ulimit at the beginning. You can pass your executable’s path to the shell script as an argument or environment variable.