boostorg / boostorg/test

BOOST_AUTO_TEST_CASE_TEMPLATE with multiple template types

Open
#322 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

I find myself with a need to do something like:

```
using test_types_1 std::tuple ;
using test_types_2 = test_types_1;

BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T1, T2, test_types_1, test_types_2 )
{
BOOST_TEST( sizeof(T1) == sizeof(T2) );
}
```
Where each call to `my_test` is the cross-product of the two vectors of test types.

As well as a need to do

```
using test_types_1 std::tuple ;
using test_types_2 = some_template_type_list;

BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T1, template T2, test_types_1, test_types_2 )
{
BOOST_TEST( T2.empty() );
}
```

Where the template type provided to BOOST_AUTO_TEST_CASE_TEMPLATE is not fully specified, and is itself a template, so that one of the other template parameter types, or manually written code inside the test, can instantiate the template as part of the test.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.