Module: xenomai-3 Branch: next Commit: 88da10c8354bd117fb176cd72bcaedaca0143021 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=88da10c8354bd117fb176cd72bcaedaca0143021
Author: Philippe Gerum <r...@xenomai.org> Date: Sat Jun 20 14:43:02 2015 +0200 lib/smokey: add trace helper --- include/smokey/smokey.h | 2 ++ lib/smokey/helpers.c | 14 ++++++++++++++ lib/smokey/init.c | 15 ++++++++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/include/smokey/smokey.h b/include/smokey/smokey.h index 0a7b5e9..cd3ca7e 100644 --- a/include/smokey/smokey.h +++ b/include/smokey/smokey.h @@ -146,6 +146,8 @@ struct smokey_arg *smokey_lookup_arg(struct smokey_test *t, int smokey_parse_args(struct smokey_test *t, int argc, char *const argv[]); +void smokey_trace(const char *fmt, ...); + void smokey_note(const char *fmt, ...); void smokey_warning(const char *file, int lineno, diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c index cef86aa..bb4902a 100644 --- a/lib/smokey/helpers.c +++ b/lib/smokey/helpers.c @@ -132,6 +132,20 @@ void smokey_note(const char *fmt, ...) va_end(ap); } +void smokey_trace(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + + if (smokey_verbose_mode > 1) { + __RT(vfprintf(stdout, fmt, ap)); + __RT(fprintf(stdout, "\n")); + } + + va_end(ap); +} + void smokey_warning(const char *file, int lineno, const char *fmt, ...) { diff --git a/lib/smokey/init.c b/lib/smokey/init.c index 876fc0d..2c16cde 100644 --- a/lib/smokey/init.c +++ b/lib/smokey/init.c @@ -199,12 +199,21 @@ * including the test detection and the active test selection have * been performed by the Smokey API already. * - * @par Issuing progress messages + * @par Issuing information notices * * The printf-like @a smokey_note() routine is available for issuing + * notices to the output device (currently stdout), unless --silent + * was detected on the command line. smokey_note() outputs a + * terminating newline character. Notes are enabled for any verbosity + * level greater than zero. + * + * @par Issuing trace messages + * + * The printf-like @a smokey_trace() routine is available for issuing * progress messages to the output device (currently stdout), unless - * --silent was detected on the command line. smokey_note() outputs - * a terminating newline character. + * --silent was detected on the command line. smokey_trace() outputs a + * terminating newline character. Traces are enabled for any verbosity + * level greater than one. * * Therefore, a possible implementation of a test driver could be as * basic as: _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git