AutoTest: Add support for templated boost tests

Change-Id: I393d20f186a47d7d1d18775a8f1102890c9de9f4
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-06-03 14:47:54 +02:00
parent c20824f5ff
commit 679b31f841
4 changed files with 27 additions and 5 deletions

View File

@@ -115,6 +115,13 @@ void BoostCodeParser::handleIdentifier()
} else if (identifier == "BOOST_DATA_TEST_CASE_F") {
m_currentState.setFlag(BoostTestTreeItem::Fixture);
handleTestCase(TestCaseType::Data);
} else if (identifier == "BOOST_AUTO_TEST_CASE_TEMPLATE") {
m_currentState.setFlag(BoostTestTreeItem::Templated);
handleTestCase(TestCaseType::Auto);
} else if (identifier == "BOOST_FIXTURE_TEST_CASE_TEMPLATE") {
m_currentState.setFlag(BoostTestTreeItem::Fixture);
m_currentState.setFlag(BoostTestTreeItem::Templated);
handleTestCase(TestCaseType::Auto);
} else if (identifier == "BOOST_TEST_DECORATOR") {
handleDecorator();
}
@@ -237,7 +244,8 @@ void BoostCodeParser::handleTestCase(TestCaseType testCaseType)
m_currentState = BoostTestTreeItem::Enabled;
}
} else {
handleDecorators();
if (!m_currentState.testFlag(BoostTestTreeItem::Templated))
handleDecorators();
locationAndType = locationAndTypeFromToken(token, m_source, m_currentState, m_suites);
m_testCases.append(locationAndType);
m_currentState = BoostTestTreeItem::Enabled;