Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parametrised test suites #5

Open
ilg-ul opened this issue Apr 5, 2022 · 0 comments
Open

Add parametrised test suites #5

ilg-ul opened this issue Apr 5, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ilg-ul
Copy link
Contributor

ilg-ul commented Apr 5, 2022

Accept something like:

static void
test_suite_args (int ic, int iv, int& ir, int* ip1, int* ip2)
{
  using namespace micro_os_plus::micro_test_plus;

  test_case ("args", [&] {
    expect (eq (ic, 42)) << "ic is 42";
    expect (eq (iv, 43)) << "iv is 43";
    expect (eq (ir, 44)) << "ir is 44";
    expect (eq (*ip1, 45)) << "*ip1 is 45";
    expect (eq (*ip2, 46)) << "*ip2 is 46";
  });
}

static int in = 43;
static int in44 = 44;
static int& ir = in44;
static int in45 = 45;
static int in46 = 46;
static int* ip2 = &in46;

static micro_os_plus::micro_test_plus::test_suite ts_args
    = { "Args", test_suite_args, 42, in, ir, &in45, ip2 };
@ilg-ul ilg-ul added the enhancement New feature or request label Apr 5, 2022
@ilg-ul ilg-ul self-assigned this Apr 5, 2022
ilg-ul added a commit that referenced this issue Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant