FD.io VPP  v21.06-1-gbb7418cf9
Vector Packet Processing
test_vector_funcs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright(c) 2021 Cisco Systems, Inc.
3  */
4 
5 #ifndef included_test_test_h
6 #define included_test_test_h
7 
8 #include <vppinfra/cpu.h>
9 
11 
12 typedef struct test_registration_
13 {
14  char *name;
19 
20 extern test_registration_t *test_registrations[CLIB_MARCH_TYPE_N_VARIANTS];
21 
22 #define __clib_test_fn static __clib_noinline __clib_section (".test_wrapper")
23 
24 #define REGISTER_TEST(x) \
25  test_registration_t CLIB_MARCH_SFX (__test_##x); \
26  static void __clib_constructor CLIB_MARCH_SFX (__test_registration_##x) ( \
27  void) \
28  { \
29  test_registration_t *r = &CLIB_MARCH_SFX (__test_##x); \
30  r->next = test_registrations[CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE)]; \
31  test_registrations[CLIB_MARCH_SFX (CLIB_MARCH_VARIANT_TYPE)] = r; \
32  } \
33  test_registration_t CLIB_MARCH_SFX (__test_##x)
34 
35 #endif
clib_error_t *() test_fn_t(clib_error_t *)
unsigned char u8
Definition: types.h:56
struct test_registration_ * next
struct test_registration_ test_registration_t