aboutsummaryrefslogtreecommitdiffstats
path: root/utils/cec-compliance/cec-compliance.h
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-06-01 13:44:12 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-06-01 13:44:12 +0200
commit034fdb4bc2dd380a3c77c0b82c03c99c222ddef4 (patch)
tree078f5c1d4cb3645d244d79bc60249291f61292ae /utils/cec-compliance/cec-compliance.h
parent5851919b5bcb8d656c410be7d17534ff88f6b234 (diff)
cec-compliance: add --exit-on-fail/warn options
These options simplify debugging: when the first fail or warning occurs, the application will call exit(1) instead of continuing. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils/cec-compliance/cec-compliance.h')
-rw-r--r--utils/cec-compliance/cec-compliance.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 3c4bf78c..eed21d77 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -112,6 +112,8 @@ struct short_audio_desc {
extern bool show_info;
extern bool show_warnings;
+extern bool exit_on_fail;
+extern bool exit_on_warn;
extern unsigned warnings;
extern unsigned reply_threshold;
extern time_t long_timeout;
@@ -211,6 +213,8 @@ struct remote_subtest {
warnings++; \
if (show_warnings) \
printf("\t\twarn: %s(%d): " fmt, __FILE__, __LINE__, ##args); \
+ if (exit_on_warn) \
+ exit(1); \
} while (0)
#define warn_once(fmt, args...) \
@@ -223,12 +227,16 @@ struct remote_subtest {
if (show_warnings) \
printf("\t\twarn: %s(%d): " fmt, \
__FILE__, __LINE__, ##args); \
+ if (exit_on_warn) \
+ exit(1); \
} \
} while (0)
#define fail(fmt, args...) \
({ \
printf("\t\tfail: %s(%d): " fmt, __FILE__, __LINE__, ##args); \
+ if (exit_on_fail) \
+ exit(1); \
FAIL; \
})

Privacy Policy