[PATCH weston v5 3/6] Enables output in the Test Anything Protocol (TAP) format.

Pekka Paalanen ppaalanen at gmail.com
Thu Jun 25 05:48:55 PDT 2015


On Sat, 20 Jun 2015 15:47:45 -0700
"Jon A. Cruz" <jonc at osg.samsung.com> wrote:

> Adds basic support for optionally outputting in the Test Anything
> Protocol (TAP) format.
> 
> This format is a bit older and simplistic, but certain tools
> handle it well.
> 
> https://testanything.org/
> 

Hi Jon,

ok, so we can produce TAP data. How would we use it? Or who would use
it? Do we know of anyone who would be using it?

A nice idea and a simple execution given your framework, but it doesn't
strike me as essential, so maybe keep this waiting for a user?

The JUnit XML sounds more useful.


Thanks,
pq


> Signed-off-by: Jon A. Cruz <jonc at osg.samsung.com>
> ---
>  Makefile.am                       |   2 +
>  tools/zunitc/inc/zunitc/zunitc.h  |   9 ++
>  tools/zunitc/src/zuc_tap_logger.c | 265 ++++++++++++++++++++++++++++++++++++++
>  tools/zunitc/src/zuc_tap_logger.h |  39 ++++++
>  tools/zunitc/src/zunitc_impl.c    |  13 ++
>  5 files changed, 328 insertions(+)
>  create mode 100644 tools/zunitc/src/zuc_tap_logger.c
>  create mode 100644 tools/zunitc/src/zuc_tap_logger.h


> diff --git a/tools/zunitc/src/zunitc_impl.c b/tools/zunitc/src/zunitc_impl.c
> index d904749..7e34aca 100644
> --- a/tools/zunitc/src/zunitc_impl.c
> +++ b/tools/zunitc/src/zunitc_impl.c
> @@ -46,6 +46,7 @@
>  #include "zuc_collector.h"
>  #include "zuc_context.h"
>  #include "zuc_event_listener.h"
> +#include "zuc_tap_logger.h"
>  
>  #include "shared/config-parser.h"
>  #include "shared/helpers.h"
> @@ -290,6 +291,12 @@ zuc_set_break_on_failure(bool break_on_failure)
>  	g_ctx.break_on_failure = break_on_failure;
>  }
>  
> +void
> +zuc_set_output_tap(bool enable)
> +{
> +	g_ctx.output_tap = enable;
> +}
> +
>  const char *
>  zuc_get_program_name(void)
>  {
> @@ -312,6 +319,7 @@ zuc_initialize(int *argc, char *argv[], bool *help_flagged)
>  	int opt_repeat = 0;
>  	int opt_random = 0;
>  	int opt_break_on_failure = 0;
> +	int opt_tap = 0;
>  	char *opt_filter = NULL;
>  
>  	char *help_param = NULL;
> @@ -324,6 +332,7 @@ zuc_initialize(int *argc, char *argv[], bool *help_flagged)
>  		{ WESTON_OPTION_INTEGER, "zuc-random", 0, &opt_random },
>  		{ WESTON_OPTION_BOOLEAN, "zuc-break-on-failure", 0,
>  		  &opt_break_on_failure },
> +		{ WESTON_OPTION_BOOLEAN, "zuc-output-tap", 0, &opt_tap },
>  		{ WESTON_OPTION_STRING, "zuc-filter", 0, &opt_filter },
>  	};
>  
> @@ -412,6 +421,7 @@ zuc_initialize(int *argc, char *argv[], bool *help_flagged)
>  		       "  --zuc-filter=FILTER\n"
>  		       "  --zuc-list-tests\n"
>  		       "  --zuc-nofork\n"
> +		       "  --zuc-output-tap\n"
>  		       "  --zuc-random=N            [0|1|<seed number>]\n"
>  		       "  --zuc-repeat=N\n"
>  		       "  --help\n",
> @@ -427,6 +437,7 @@ zuc_initialize(int *argc, char *argv[], bool *help_flagged)
>  		zuc_set_random(opt_random);
>  		zuc_set_spawn(!opt_nofork);
>  		zuc_set_break_on_failure(opt_break_on_failure);
> +		zuc_set_output_tap(opt_tap);
>  		rc = EXIT_SUCCESS;
>  	}
>  
> @@ -959,6 +970,8 @@ zucimpl_run_tests(void)
>  	if (g_ctx.listeners == NULL) {
>  		zuc_add_event_listener(zuc_collector_create(&(g_ctx.fds[1])));
>  		zuc_add_event_listener(zuc_base_logger_create());
> +		if (g_ctx.output_tap)
> +			zuc_add_event_listener(zuc_tap_logger_create());
>  	}
>  
>  	if (g_ctx.case_count < 1) {



More information about the wayland-devel mailing list