diff mbox

validation: do not print functions name and files

Message ID 1419268685-13886-1-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov Dec. 22, 2014, 5:18 p.m. UTC
Current test output is too long and even prints data from empty prints:
odp_buffer_pool.c:91:odp_buffer_pool_init_global():  pool_entry_s size     256
odp_buffer_pool.c:92:odp_buffer_pool_init_global():  pool_entry_t size     256
odp_buffer_pool.c:93:odp_buffer_pool_init_global():  odp_buffer_hdr_t size 112
odp_buffer_pool.c:94:odp_buffer_pool_init_global():

Remove file and function names prefixes for validation tests.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 test/validation/common/odp_cunit_common.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Mike Holmes Dec. 22, 2014, 5:28 p.m. UTC | #1
I could see dropping __FILE__  but because these are tests, surely knowing
what produced the output is valuable.

Doing the override at all is a test we need to add :)

On 22 December 2014 at 12:18, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> Current test output is too long and even prints data from empty prints:
> odp_buffer_pool.c:91:odp_buffer_pool_init_global():  pool_entry_s size
>  256
> odp_buffer_pool.c:92:odp_buffer_pool_init_global():  pool_entry_t size
>  256
> odp_buffer_pool.c:93:odp_buffer_pool_init_global():  odp_buffer_hdr_t size
> 112
> odp_buffer_pool.c:94:odp_buffer_pool_init_global():
>
> Remove file and function names prefixes for validation tests.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  test/validation/common/odp_cunit_common.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/test/validation/common/odp_cunit_common.c
> b/test/validation/common/odp_cunit_common.c
> index 2fab033..cefeaf0 100644
> --- a/test/validation/common/odp_cunit_common.c
> +++ b/test/validation/common/odp_cunit_common.c
> @@ -14,6 +14,9 @@
>  #include <odp.h>
>  #include <odp_cunit_common.h>
>  #include <odph_linux.h>
> +#include <stdarg.h>
> +#include <string.h>
> +
>  /* Globals */
>  static odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>
> @@ -41,6 +44,25 @@ __attribute__((__weak__)) int tests_global_init(void)
>         return 0;
>  }
>
> +int odp_override_log(odp_log_level_e level __attribute__((__unused__)),
> +                                    const char *fmt, ...)
> +{
> +       va_list args;
> +       int r;
> +
> +       va_start(args, fmt);
> +
> +       /* Skip __FILE__, __LINE__, __func__ output */
> +       va_arg(args, char *);
> +       va_arg(args, int);
> +       va_arg(args, char *);
> +
> +       r = vfprintf(stderr, " ", args);
> +       va_end(args);
> +
> +       return r;
> +}
> +
>  int main(void)
>  {
>         int ret;
> --
> 1.8.5.1.163.gd7aced9
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov Dec. 23, 2014, 8:10 a.m. UTC | #2
On 12/22/2014 08:28 PM, Mike Holmes wrote:
> I could see dropping __FILE__  but because these are tests, surely 
> knowing what produced the output is valuable.
>
It's ok if it's needed for somebody. For me it's useless.
Let's drop this patch then.

Maxim.

> Doing the override at all is a test we need to add :)
>
> On 22 December 2014 at 12:18, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Current test output is too long and even prints data from empty
>     prints:
>     odp_buffer_pool.c:91:odp_buffer_pool_init_global(): pool_entry_s
>     size     256
>     odp_buffer_pool.c:92:odp_buffer_pool_init_global(): pool_entry_t
>     size     256
>     odp_buffer_pool.c:93:odp_buffer_pool_init_global():
>     odp_buffer_hdr_t size 112
>     odp_buffer_pool.c:94:odp_buffer_pool_init_global():
>
>     Remove file and function names prefixes for validation tests.
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>     ---
>      test/validation/common/odp_cunit_common.c | 22 ++++++++++++++++++++++
>      1 file changed, 22 insertions(+)
>
>     diff --git a/test/validation/common/odp_cunit_common.c
>     b/test/validation/common/odp_cunit_common.c
>     index 2fab033..cefeaf0 100644
>     --- a/test/validation/common/odp_cunit_common.c
>     +++ b/test/validation/common/odp_cunit_common.c
>     @@ -14,6 +14,9 @@
>      #include <odp.h>
>      #include <odp_cunit_common.h>
>      #include <odph_linux.h>
>     +#include <stdarg.h>
>     +#include <string.h>
>     +
>      /* Globals */
>      static odph_linux_pthread_t thread_tbl[MAX_WORKERS];
>
>     @@ -41,6 +44,25 @@ __attribute__((__weak__)) int
>     tests_global_init(void)
>             return 0;
>      }
>
>     +int odp_override_log(odp_log_level_e level
>     __attribute__((__unused__)),
>     +                                    const char *fmt, ...)
>     +{
>     +       va_list args;
>     +       int r;
>     +
>     +       va_start(args, fmt);
>     +
>     +       /* Skip __FILE__, __LINE__, __func__ output */
>     +       va_arg(args, char *);
>     +       va_arg(args, int);
>     +       va_arg(args, char *);
>     +
>     +       r = vfprintf(stderr, " ", args);
>     +       va_end(args);
>     +
>     +       return r;
>     +}
>     +
>      int main(void)
>      {
>             int ret;
>     --
>     1.8.5.1.163.gd7aced9
>
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     http://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> -- 
> *Mike Holmes*
> Linaro  Sr Technical Manager
> LNG - ODP
diff mbox

Patch

diff --git a/test/validation/common/odp_cunit_common.c b/test/validation/common/odp_cunit_common.c
index 2fab033..cefeaf0 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -14,6 +14,9 @@ 
 #include <odp.h>
 #include <odp_cunit_common.h>
 #include <odph_linux.h>
+#include <stdarg.h>
+#include <string.h>
+
 /* Globals */
 static odph_linux_pthread_t thread_tbl[MAX_WORKERS];
 
@@ -41,6 +44,25 @@  __attribute__((__weak__)) int tests_global_init(void)
 	return 0;
 }
 
+int odp_override_log(odp_log_level_e level __attribute__((__unused__)),
+				     const char *fmt, ...)
+{
+	va_list args;
+	int r;
+
+	va_start(args, fmt);
+
+	/* Skip __FILE__, __LINE__, __func__ output */
+	va_arg(args, char *);
+	va_arg(args, int);
+	va_arg(args, char *);
+
+	r = vfprintf(stderr, " ", args);
+	va_end(args);
+
+	return r;
+}
+
 int main(void)
 {
 	int ret;