Skip to content

Conversation

@mattdurak
Copy link
Contributor

Usage:

  PARAMETERIZED_TEST_FUNCTION(base_name,
      ARGS(type1, param1, type2, param2),
      CASE((value1, value2), suffix1),
      CASE((value3, value4), suffix2))
  {
      // test code using param1, param2
  }

#define DISABLED_TEST_FUNCTION(name) void name(void)

/*
* PARAMETERIZED_TEST_FUNCTION - A macro for defining parameterized test functions
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open item: Should we have some MD for this? We don't have docs for c-testrunnerswitcher

#define PTRS_ARGS_DECL_MORE(t1, n1, ...) t1 n1 PTRS_ARGS_DECL_REST(__VA_ARGS__)
#define PTRS_ARGS_DECL_DISPATCH_0(...) PTRS_ARGS_DECL_MORE(__VA_ARGS__)
#define PTRS_ARGS_DECL_DISPATCH_1(...) PTRS_ARGS_DECL_2(__VA_ARGS__)
#define PTRS_ARGS_DECL(...) MU_C2(PTRS_ARGS_DECL_DISPATCH_, MU_ISEMPTY(MU_IF(MU_ISZERO(MU_DEC(MU_DEC(MU_COUNT_ARG(__VA_ARGS__)))), 1, )))(__VA_ARGS__)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a feeling this can be re-written with macro_utils, this is just what the bot came up with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants