Validate exit code in tests.