Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

BOOST_AUTO_TEST_CASE_TEMPLATE with multiple template types

Open
#322 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
testing

Research direction

Start by reviewing the current BOOST_AUTO_TEST_CASE_TEMPLATE interface and how it handles template parameters. The requested behavior is support for cross-products of multiple type lists and for template types that remain partially specified; done means both example forms can define and run the intended test cases.

Written by the indexing model from the issue text.

Description

I find myself with a need to do something like:

using test_types_1 std::tuple<int,long,unsigned char> ;
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<int,long,unsigned char> ;
using test_types_2 = some_template_type_list<std::vector, std::array, std::set>;

BOOST_AUTO_TEST_CASE_TEMPLATE( my_test, T1, template<typename ...> T2, test_types_1, test_types_2 )
{
  BOOST_TEST( T2<T1>.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.

Dominant language
C++
Stars
217
Forks
149
Avg merge
18h 41m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/test

All issues in boostorg/test

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.