From 5428ad50015b500e6a67f2aa2abe24f55c00c2c3 Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Wed, 11 Dec 2013 15:58:24 -0500 Subject: Bug 422962 - Boost Testrunner: BOOST_PARAM_TEST_CASE not working Change-Id: I8815163c15ba9cd1c2fd0b5ba4ffe7a701fb6b3c Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/19679 Tested-by: Hudson CI --- .../internal/boost/BoostXmlLogHandler.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'testsrunner/org.eclipse.cdt.testsrunner.boost') diff --git a/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java b/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java index 08b40e823f6..e8c25f46148 100644 --- a/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java +++ b/testsrunner/org.eclipse.cdt.testsrunner.boost/src/org/eclipse/cdt/testsrunner/internal/boost/BoostXmlLogHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Anton Gorenkov + * Copyright (c) 2011, 2013 Anton Gorenkov and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Anton Gorenkov - initial API and implementation + * Marc-Andre Laperle (Ericsson) *******************************************************************************/ package org.eclipse.cdt.testsrunner.internal.boost; @@ -87,7 +88,14 @@ public class BoostXmlLogHandler extends DefaultHandler { /** Current test case status. */ private ITestItem.Status testStatus; - + /** + * Keep track of the last test case name so that we can handle + * parameterized test cases which have the same name + */ + private String lastTestCaseName = ""; //$NON-NLS-1$ + private static final int SAME_TEST_CASE_NAME_COUNT_START = 2; + private int sameTestCaseNameCount = SAME_TEST_CASE_NAME_COUNT_START; + BoostXmlLogHandler(ITestModelUpdater modelUpdater) { this.modelUpdater = modelUpdater; } @@ -102,6 +110,15 @@ public class BoostXmlLogHandler extends DefaultHandler { } else if (qName == XML_NODE_TEST_CASE) { String testCaseName = attrs.getValue(XML_ATTR_TEST_CASE_NAME); + + if (lastTestCaseName.equals(testCaseName)) { + testCaseName += " (" + sameTestCaseNameCount + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + ++sameTestCaseNameCount; + } else { + lastTestCaseName = testCaseName; + sameTestCaseNameCount = SAME_TEST_CASE_NAME_COUNT_START; + } + modelUpdater.enterTestCase(testCaseName); testStatus = Status.Passed; -- cgit v1.2.3