Testing error handling: programs that should return nonzero/write on stderr?

Testing error handling: programs that should return nonzero/write on stderr?

by Matteo Dell'Amico -
Number of replies: 1

Hi, and thanks for this amazing project! We're teaching students to handle errors when parsing input in C++, returning nonzero values, and writing to stderr when they receive incorrect input.

I don't see an obvious way to do that, since the default question modes do not allow specifying anything else than stdout and accept only zero return value. Should I write a wrapper that puts return value, stdout and stderr to stdout?

In reply to Matteo Dell'Amico

Re: Testing error handling: programs that should return nonzero/write on stderr?

by Richard Lobb -
Yes, you need to write your own question type (or extensively customise individual questions) to manage the whole compile-and-execute sequence. The c_via_python question type in the documentation should be a good starting point.