vppinfra: add universal array mask_compare and compress funcs
[vpp.git] / src / vppinfra / test_vector_funcs.c
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright(c) 2021 Cisco Systems, Inc.
3  */
4
5 #include <vppinfra/format.h>
6 #include <vppinfra/test_vector_funcs.h>
7
8 test_registration_t *test_registrations[CLIB_MARCH_TYPE_N_VARIANTS] = {};
9
10 int
11 main (int argc, char *argv[])
12 {
13   clib_mem_init (0, 64ULL << 20);
14
15   for (int i = 0; i < CLIB_MARCH_TYPE_N_VARIANTS; i++)
16     {
17       test_registration_t *r = test_registrations[i];
18
19       if (r == 0)
20         continue;
21
22       fformat (stdout, "\nMultiarch Variant: %U\n", format_march_variant, i);
23       fformat (stdout,
24                "-------------------------------------------------------\n");
25       while (r)
26         {
27           clib_error_t *err;
28           err = (r->fn) (0);
29           fformat (stdout, "%-50s %s\n", r->name, err ? "FAIL" : "PASS");
30           if (err)
31             {
32               clib_error_report (err);
33               fformat (stdout, "\n");
34             }
35
36           r = r->next;
37         }
38     }
39
40   fformat (stdout, "\n");
41   return 0;
42 }