Boost logo

Boost :

Subject: Re: [boost] [test] Test cases parametrized by both type and value?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-01-05 15:26:35


AMDG

On 01/05/2018 04:39 AM, Andrzej Krzemienski via Boost wrote:
> <snip>
> But maybe there exists a direct solution in Boost.Test? Where I would just
> pass a list of values: `{1, 10, 1.0, "Y"}`
>
> It is easy to deduce types from values:
>
> ```
> template <typename... T>
> mpl::liss<T...> Values(T... values);
>
> using test_types = decltype(Values(1, 10, 1.0, "Y"));
> ```
>
> Does something like this exist, or ois it a reasonable extension?
>
It isn't supported, but seems to be intended at some point:

http://www.boost.org/libs/test/doc/html/boost_test/tests_organization/test_cases/test_case_generation/datasets.html#ftn.boost_test.tests_organization.test_cases.test_case_generation.datasets.f0

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk