1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 210366 - CDT should have Unit Testing and Component Testing like JDT

This commit is contained in:
Anton Gorenkov 2012-04-17 23:50:07 -04:00 committed by Marc-Andre Laperle
parent 83cf5dc830
commit f16f0dbe48
202 changed files with 15775 additions and 0 deletions

View file

@ -171,6 +171,14 @@
<module>build/org.eclipse.cdt.autotools.source-feature</module>
<module>build/org.eclipse.linuxtools.cdt.autotools.core</module>
<module>testsrunner/org.eclipse.cdt.testsrunner</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.boost</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.gtest</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.qttest</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.test</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.feature</module>
<module>testsrunner/org.eclipse.cdt.testsrunner.source.feature</module>
<!--
<module>lrparser/org.eclipse.cdt.core.lrparser.tests</module>
<module>upc/org.eclipse.cdt.core.parser.upc.tests</module>

View file

@ -65,4 +65,10 @@
<feature url="features/org.eclipse.cdt.autotools.source_0.0.0.qualifier.jar" id="org.eclipse.cdt.autotools.source" version="0.0.0">
<category name="extra"/>
</feature>
<feature url="features/org.eclipse.cdt.testsrunner.feature_0.0.0.qualifier.jar" id="org.eclipse.cdt.testsrunner.feature" version="0.0.0">
<category name="extra"/>
</feature>
<feature url="features/org.eclipse.cdt.testsrunner.source.feature_0.0.0.qualifier.jar" id="org.eclipse.cdt.testsrunner.source.feature" version="0.0.0">
<category name="extra"/>
</feature>
</site>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner.boost</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,82 @@
#Mon Apr 16 13:01:24 EEST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.testsrunner.boost;singleton:=true
Bundle-Version: 7.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.testsrunner.internal.boost.BoostTestsRunnerPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.cdt.testsrunner;bundle-version="3.5.0"
Export-Package: org.eclipse.cdt.testsrunner.internal.boost;x-friends:="org.eclipse.cdt.testsrunner.test"

View file

@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 22, 2007</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html>

View file

@ -0,0 +1,21 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
bin.includes = plugin.xml,\
plugin.properties,\
about.html,\
.,\
META-INF/
javadoc.packages = org.eclipse.cdt.launch.ui.*,\
org.eclipse.cdt.launch.sourcelookup*,\
org.eclipse.cdt.launch.*
source.. = src/
src.includes = about.html

View file

@ -0,0 +1,15 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
pluginName=C/C++ Development Tools Boost Tests Runner Support
providerName=Eclipse CDT
BoostTestsRunner.name=Boost Tests Runner
BoostTestsRunner.description=Tests runner for a test module based on Boost.Test library

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.cdt.testsrunner.TestsRunner">
<runner
class="org.eclipse.cdt.testsrunner.internal.boost.BoostTestsRunnerProvider"
description="%BoostTestsRunner.description"
id="org.eclipse.cdt.testsrunner.boost"
name="%BoostTestsRunner.name">
</runner>
</extension>
</plugin>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<version>7.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.testsrunner.boost</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov.
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.boost;
import org.eclipse.osgi.util.NLS;
public class BoostTestsRunnerMessages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.testsrunner.internal.boost.BoostTestsRunnerMessages"; //$NON-NLS-1$
public static String BoostTestsRunner_error_format;
public static String BoostTestsRunner_io_error_prefix;
public static String BoostTestsRunner_wrong_tests_paths_count;
public static String BoostTestsRunner_xml_error_prefix;
public static String BoostXmlLogHandler_exception_suffix;
public static String BoostXmlLogHandler_wrong_tag_name;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, BoostTestsRunnerMessages.class);
}
private BoostTestsRunnerMessages() {
}
}

View file

@ -0,0 +1,16 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
BoostTestsRunner_error_format={0}: {1}
BoostTestsRunner_io_error_prefix=I/O Error
BoostTestsRunner_wrong_tests_paths_count=Only on test suite or test case should be specified to rerun
BoostTestsRunner_xml_error_prefix=XML parse error
BoostXmlLogHandler_exception_suffix=\nLast check point was here.
BoostXmlLogHandler_wrong_tag_name=Invalid XML format: Element "{0}" is not accepted\!

View file

@ -0,0 +1,67 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.boost;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
/**
* The activator class controls the plug-in life cycle
*/
public class BoostTestsRunnerPlugin extends Plugin {
/** The plug-in ID .*/
public static final String PLUGIN_ID = "org.eclipse.cdt.testsrunner.boost"; //$NON-NLS-1$
/** Plug-in instance. */
private static BoostTestsRunnerPlugin plugin;
public BoostTestsRunnerPlugin() {
super();
plugin = this;
}
/**
* Returns the Boost Tests Runner provider plug-in instance.
*
* @return the plug-in instance
*/
public static BoostTestsRunnerPlugin getDefault() {
return plugin;
}
/** Convenience method which returns the unique identifier of this plugin. */
public static String getUniqueIdentifier() {
return PLUGIN_ID;
}
/**
* Logs the specified status with this plug-in's log.
*
* @param status status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
/**
* Logs an internal error with the specified throwable
*
* @param e the exception to be logged
*/
public static void log(Throwable e) {
log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e));
}
}

View file

@ -0,0 +1,113 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.boost;
import java.io.IOException;
import java.io.InputStream;
import java.text.MessageFormat;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.TestingException;
import org.xml.sax.SAXException;
/**
* The Tests Runner provider plug-in to run tests with Boost.Test framework.
*
* Configures the test module to output in XML format, parses the output and
* provides the data for the Tests Runner Core.
*
* @note There is a note about Tests Runner provider plug-in accuracy. Communication
* between Boost test module and Boost Tests Runner provider plug-in is done through
* standard output (which is buffered by default). Boost.Test (at least current
* version - 1.48.0) does not provide a way to flush the data about tests
* execution when they are available, so there may be a delay between test event
* happening (e.g. test case is started) and its displaying in the results view.
* The possible solution is to turn off the standard output buffering like this:
* <pre>
* static struct DisableStdCoutBuffering
* {
* DisableStdCoutBuffering()
* {
* std::cout.setf(std::ios_base::unitbuf);
* }
* } s_disableStdCoutBuffering;
* </pre>
* It will make the results view showing progress more accurate.
*/
public class BoostTestsRunnerProvider implements ITestsRunnerProvider {
@Override
public String[] getAdditionalLaunchParameters(String[][] testPaths) throws TestingException {
final String[] boostParameters = {
"--output_format=xml", //$NON-NLS-1$
"--log_level=all", //$NON-NLS-1$
"--report_level=no" //$NON-NLS-1$
};
String[] result = boostParameters;
// Build tests filter
if (testPaths != null && testPaths.length >= 1) {
if (testPaths.length != 1) {
throw new TestingException(BoostTestsRunnerMessages.BoostTestsRunner_wrong_tests_paths_count);
}
StringBuilder sb = new StringBuilder("--run_test="); //$NON-NLS-1$
String[] testPath = testPaths[0];
for (int i = 1; i < testPath.length; i++) {
if (i != 1) {
sb.append("/"); //$NON-NLS-1$
}
sb.append(testPath[i]);
}
result = new String[boostParameters.length + 1];
System.arraycopy(boostParameters, 0, result, 0, boostParameters.length);
result[boostParameters.length] = sb.toString();
}
return result;
}
/**
* Construct the error message from prefix and detailed description.
*
* @param prefix prefix
* @param description detailed description
* @return the full message
*/
private String getErrorText(String prefix, String description) {
return MessageFormat.format(BoostTestsRunnerMessages.BoostTestsRunner_error_format, prefix, description);
}
@Override
public void run(ITestModelUpdater modelUpdater, InputStream inputStream) throws TestingException {
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
sp.parse(inputStream, new BoostXmlLogHandler(modelUpdater));
} catch (IOException e) {
throw new TestingException(getErrorText(BoostTestsRunnerMessages.BoostTestsRunner_io_error_prefix, e.getLocalizedMessage()));
} catch (NumberFormatException e) {
throw new TestingException(getErrorText(BoostTestsRunnerMessages.BoostTestsRunner_xml_error_prefix, e.getLocalizedMessage()));
} catch (ParserConfigurationException e) {
throw new TestingException(getErrorText(BoostTestsRunnerMessages.BoostTestsRunner_xml_error_prefix, e.getLocalizedMessage()));
} catch (SAXException e) {
throw new TestingException(getErrorText(BoostTestsRunnerMessages.BoostTestsRunner_xml_error_prefix, e.getLocalizedMessage()));
}
}
}

View file

@ -0,0 +1,229 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.boost;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Stack;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
import org.eclipse.cdt.testsrunner.model.ITestItem.Status;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
* Parses the Boost.Test XML log and notifies the Tests Runner Core about how
* the testing process is going.
*/
public class BoostXmlLogHandler extends DefaultHandler {
// Boost.Test XML log tags
private static final String XML_NODE_TEST_LOG = "TestLog"; //$NON-NLS-1$
private static final String XML_NODE_TEST_SUITE = "TestSuite"; //$NON-NLS-1$
private static final String XML_NODE_TEST_CASE = "TestCase"; //$NON-NLS-1$
private static final String XML_NODE_TESTING_TIME = "TestingTime"; //$NON-NLS-1$
private static final String XML_NODE_LAST_CHECKPOINT = "LastCheckpoint"; //$NON-NLS-1$
// Boost.Test XML log message levels representation
private static final String XML_NODE_INFO = "Info"; //$NON-NLS-1$
private static final String XML_NODE_MESSAGE = "Message"; //$NON-NLS-1$
private static final String XML_NODE_WARNING = "Warning"; //$NON-NLS-1$
private static final String XML_NODE_ERROR = "Error"; //$NON-NLS-1$
private static final String XML_NODE_FATAL_ERROR = "FatalError"; //$NON-NLS-1$
private static final String XML_NODE_EXCEPTION = "Exception"; //$NON-NLS-1$
// Boost.Test XML log attributes
private static final String XML_ATTR_TEST_SUITE_NAME = "name"; //$NON-NLS-1$
private static final String XML_ATTR_TEST_CASE_NAME = "name"; //$NON-NLS-1$
private static final String XML_ATTR_MESSAGE_FILE = "file"; //$NON-NLS-1$
private static final String XML_ATTR_MESSAGE_LINE = "line"; //$NON-NLS-1$
/** Maps the string message level representation to the Tests Runner internal enum code. */
private static final Map<String, ITestMessage.Level> STRING_TO_MESSAGE_LEVEL;
static {
Map<String, ITestMessage.Level> aMap = new HashMap<String, ITestMessage.Level>();
aMap.put(XML_NODE_INFO, ITestMessage.Level.Info);
aMap.put(XML_NODE_MESSAGE, ITestMessage.Level.Message);
aMap.put(XML_NODE_WARNING, ITestMessage.Level.Warning);
aMap.put(XML_NODE_ERROR, ITestMessage.Level.Error);
aMap.put(XML_NODE_FATAL_ERROR, ITestMessage.Level.FatalError);
// NOTE: Exception node is processed separately
STRING_TO_MESSAGE_LEVEL = Collections.unmodifiableMap(aMap);
}
/** The default file name for test message location. */
private static final String DEFAULT_LOCATION_FILE = null;
/** The default line number for test message location. */
private static final int DEFAULT_LOCATION_LINE = -1;
/** The interface to notify the Tests Runner Core */
private ITestModelUpdater modelUpdater;
/** Stores the text between XML tags. */
private Stack<StringBuilder> elementDataStack = new Stack<StringBuilder>();
/** File name for current test message location. */
private String fileName;
/** Line number for current test message location. */
private int lineNumber;
/** Current test case status. */
private ITestItem.Status testStatus;
BoostXmlLogHandler(ITestModelUpdater modelUpdater) {
this.modelUpdater = modelUpdater;
}
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException {
elementDataStack.push(new StringBuilder());
if (qName == XML_NODE_TEST_SUITE) {
String testSuiteName = attrs.getValue(XML_ATTR_TEST_SUITE_NAME);
modelUpdater.enterTestSuite(testSuiteName);
} else if (qName == XML_NODE_TEST_CASE) {
String testCaseName = attrs.getValue(XML_ATTR_TEST_CASE_NAME);
modelUpdater.enterTestCase(testCaseName);
testStatus = Status.Passed;
} else if (STRING_TO_MESSAGE_LEVEL.containsKey(qName)
|| qName == XML_NODE_LAST_CHECKPOINT) {
fileName = attrs.getValue(XML_ATTR_MESSAGE_FILE);
String lineNumberStr = attrs.getValue(XML_ATTR_MESSAGE_LINE);
lineNumber = lineNumberStr != null ? Integer.parseInt(lineNumberStr.trim()) : DEFAULT_LOCATION_LINE;
} else if (qName == XML_NODE_EXCEPTION) {
fileName = DEFAULT_LOCATION_FILE;
lineNumber = DEFAULT_LOCATION_LINE;
} else if (qName == XML_NODE_TESTING_TIME ) {
} else if (qName == XML_NODE_TEST_LOG) {
/* just skip, do nothing */
} else {
logAndThrowErrorForElement(qName);
}
}
/**
* Common routing: notifies the Tests Runner core about new test message
* and resets the internal state.
*
* @param level test message level
*/
private void addCurrentMessage(ITestMessage.Level level) {
modelUpdater.addTestMessage(fileName, lineNumber, level, elementDataStack.peek().toString());
fileName = DEFAULT_LOCATION_FILE;
lineNumber = DEFAULT_LOCATION_LINE;
if (level == ITestMessage.Level.Error || level == ITestMessage.Level.FatalError) {
if (testStatus != ITestItem.Status.Aborted) {
testStatus = ITestItem.Status.Failed;
}
} else if (level == ITestMessage.Level.Exception) {
testStatus = ITestItem.Status.Aborted;
}
}
@Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
if (qName == XML_NODE_TEST_SUITE) {
modelUpdater.exitTestSuite();
} else if (qName == XML_NODE_TEST_CASE) {
modelUpdater.setTestStatus(testStatus);
modelUpdater.exitTestCase();
} else if (qName == XML_NODE_TESTING_TIME) {
modelUpdater.setTestingTime(Integer.parseInt(elementDataStack.peek().toString().trim())/1000);
} else if (STRING_TO_MESSAGE_LEVEL.containsKey(qName)) {
addCurrentMessage(STRING_TO_MESSAGE_LEVEL.get(qName));
} else if (qName == XML_NODE_EXCEPTION) {
if (fileName != DEFAULT_LOCATION_FILE && !fileName.isEmpty() && lineNumber >= 0) {
elementDataStack.peek().append(BoostTestsRunnerMessages.BoostXmlLogHandler_exception_suffix);
}
addCurrentMessage(ITestMessage.Level.Exception);
} else if (qName == XML_NODE_TEST_LOG || qName == XML_NODE_LAST_CHECKPOINT) {
/* just skip, do nothing */
} else {
logAndThrowErrorForElement(qName);
}
elementDataStack.pop();
}
@Override
public void characters(char[] ch, int start, int length) {
StringBuilder builder = elementDataStack.peek();
for (int i = start; i < start + length; i++) {
builder.append(ch[i]);
}
}
/**
* Throws the testing exception for the specified XML tag.
*
* @param tagName XML tag name
* @throws SAXException the exception that will be thrown
*/
private void logAndThrowErrorForElement(String tagName) throws SAXException {
logAndThrowError(
MessageFormat.format(BoostTestsRunnerMessages.BoostXmlLogHandler_wrong_tag_name, tagName)
);
}
/**
* Throws the testing exception with the specified message.
*
* @param message the reason
* @throws SAXException the exception that will be thrown
*/
private void logAndThrowError(String message) throws SAXException {
SAXException e = new SAXException(message);
BoostTestsRunnerPlugin.log(e);
throw e;
}
@Override
public void warning(SAXParseException ex) throws SAXException {
BoostTestsRunnerPlugin.log(ex);
}
@Override
public void error(SAXParseException ex) throws SAXException {
BoostTestsRunnerPlugin.log(ex);
throw ex;
}
@Override
public void fatalError(SAXParseException ex) throws SAXException {
BoostTestsRunnerPlugin.log(ex);
throw ex;
}
}

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,16 @@
###############################################################################
# Copyright (c) 2012 Marc-Andre Laperle 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Marc-Andre Laperle - initial API and implementation
###############################################################################
bin.includes = feature.xml,\
epl-v10.html,\
eclipse_update_120.jpg,\
feature.properties,\
license.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -0,0 +1,328 @@
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List
href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
<title>Eclipse Public License - Version 1.0</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>2</o:Revision>
<o:TotalTime>3</o:TotalTime>
<o:Created>2004-03-05T23:03:00Z</o:Created>
<o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
<o:Pages>4</o:Pages>
<o:Words>1626</o:Words>
<o:Characters>9270</o:Characters>
<o:Lines>77</o:Lines>
<o:Paragraphs>18</o:Paragraphs>
<o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
<o:Version>9.4402</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:TrackRevisions/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{margin-right:0in;
mso-margin-top-alt:auto;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.BalloonText, li.BalloonText, div.BalloonText
{mso-style-name:"Balloon Text";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
font-family:Tahoma;
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
</p>
<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
OF THIS AGREEMENT.</span> </p>
<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
in the case of the initial Contributor, the initial code and documentation
distributed under this Agreement, and<br clear=left>
b) in the case of each subsequent Contributor:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
changes to the Program, and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
additions to the Program;</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
such changes and/or additions to the Program originate from and are distributed
by that particular Contributor. A Contribution 'originates' from a Contributor
if it was added to the Program by such Contributor itself or anyone acting on
such Contributor's behalf. Contributions do not include additions to the
Program which: (i) are separate modules of software distributed in conjunction
with the Program under their own license agreement, and (ii) are not derivative
works of the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
entity that distributes the Program.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
claims licensable by a Contributor which are necessarily infringed by the use
or sale of its Contribution alone or when combined with the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
distributed in accordance with this Agreement.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
receives the Program under this Agreement, including all Contributors.</span> </p>
<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
Subject to the terms of this Agreement, each Contributor hereby grants Recipient
a non-exclusive, worldwide, royalty-free copyright license to<span
style='color:red'> </span>reproduce, prepare derivative works of, publicly
display, publicly perform, distribute and sublicense the Contribution of such
Contributor, if any, and such derivative works, in source code and object code
form.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
patent license under Licensed Patents to make, use, sell, offer to sell, import
and otherwise transfer the Contribution of such Contributor, if any, in source
code and object code form. This patent license shall apply to the combination
of the Contribution and the Program if, at the time the Contribution is added
by the Contributor, such addition of the Contribution causes such combination
to be covered by the Licensed Patents. The patent license shall not apply to
any other combinations which include the Contribution. No hardware per se is
licensed hereunder. </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
Recipient understands that although each Contributor grants the licenses to its
Contributions set forth herein, no assurances are provided by any Contributor
that the Program does not infringe the patent or other intellectual property
rights of any other entity. Each Contributor disclaims any liability to Recipient
for claims brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the rights and
licenses granted hereunder, each Recipient hereby assumes sole responsibility
to secure any other intellectual property rights needed, if any. For example,
if a third party patent license is required to allow Recipient to distribute
the Program, it is Recipient's responsibility to acquire that license before
distributing the Program.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
Each Contributor represents that to its knowledge it has sufficient copyright
rights in its Contribution, if any, to grant the copyright license set forth in
this Agreement. </span></p>
<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
Program in object code form under its own license agreement, provided that:</span>
</p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it complies with the terms and conditions of this Agreement; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
its license agreement:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title
and non-infringement, and implied warranties or conditions of merchantability
and fitness for a particular purpose; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
effectively excludes on behalf of all Contributors all liability for damages,
including direct, indirect, special, incidental and consequential damages, such
as lost profits; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
states that any provisions which differ from this Agreement are offered by that
Contributor alone and not by any other party; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
states that source code for the Program is available from such Contributor, and
informs licensees how to obtain it in a reasonable manner on or through a
medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
<p><span style='font-size:10.0pt'>When the Program is made available in source
code form:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it must be made available under this Agreement; and </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
copy of this Agreement must be included with each copy of the Program. </span></p>
<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
copyright notices contained within the Program. </span></p>
<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
originator of its Contribution, if any, in a manner that reasonably allows
subsequent Recipients to identify the originator of the Contribution. </span></p>
<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
<p><span style='font-size:10.0pt'>Commercial distributors of software may
accept certain responsibilities with respect to end users, business partners
and the like. While this license is intended to facilitate the commercial use
of the Program, the Contributor who includes the Program in a commercial
product offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes the
Program in a commercial product offering, such Contributor (&quot;Commercial
Contributor&quot;) hereby agrees to defend and indemnify every other
Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
legal actions brought by a third party against the Indemnified Contributor to
the extent caused by the acts or omissions of such Commercial Contributor in
connection with its distribution of the Program in a commercial product
offering. The obligations in this section do not apply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In order
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial Contributor
to control, and cooperate with the Commercial Contributor in, the defense and
any related settlement negotiations. The Indemnified Contributor may participate
in any such claim at its own expense.</span> </p>
<p><span style='font-size:10.0pt'>For example, a Contributor might include the
Program in a commercial product offering, Product X. That Contributor is then a
Commercial Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance claims and
warranties are such Commercial Contributor's responsibility alone. Under this
section, the Commercial Contributor would have to defend claims against the
other Contributors related to those performance claims and warranties, and if a
court requires any other Contributor to pay any damages as a result, the
Commercial Contributor must pay those damages.</span> </p>
<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and distributing the
Program and assumes all risks associated with its exercise of rights under this
Agreement , including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs or
equipment, and unavailability or interruption of operations. </span></p>
<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
or unenforceable under applicable law, it shall not affect the validity or
enforceability of the remainder of the terms of this Agreement, and without
further action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.</span> </p>
<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
against any entity (including a cross-claim or counterclaim in a lawsuit)
alleging that the Program itself (excluding combinations of the Program with
other software or hardware) infringes such Recipient's patent(s), then such
Recipient's rights granted under Section 2(b) shall terminate as of the date
such litigation is filed. </span></p>
<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
shall terminate if it fails to comply with any of the material terms or
conditions of this Agreement and does not cure such failure in a reasonable
period of time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use and
distribution of the Program as soon as reasonably practicable. However,
Recipient's obligations under this Agreement and any licenses granted by
Recipient relating to the Program shall continue and survive. </span></p>
<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
copies of this Agreement, but in order to avoid inconsistency the Agreement is
copyrighted and may only be modified in the following manner. The Agreement
Steward reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement Steward has
the right to modify this Agreement. The Eclipse Foundation is the initial
Agreement Steward. The Eclipse Foundation may assign the responsibility to
serve as the Agreement Steward to a suitable separate entity. Each new version
of the Agreement will be given a distinguishing version number. The Program
(including Contributions) may always be distributed subject to the version of
the Agreement under which it was received. In addition, after a new version of
the Agreement is published, Contributor may elect to distribute the Program
(including its Contributions) under the new version. Except as expressly stated
in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
the intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not
expressly granted under this Agreement are reserved.</span> </p>
<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
State of New York and the intellectual property laws of the United States of
America. No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose. Each party waives
its rights to a jury trial in any resulting litigation.</span> </p>
<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
</div>
</body>
</html>

View file

@ -0,0 +1,168 @@
###############################################################################
# Copyright (c) 2012 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - initial API and implementation
# Marc-Andre Laperle
###############################################################################
# features.properties
# contains externalized strings for feature.xml
# "%foo" in feature.xml corresponds to the key "foo" in this file
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file should be translated.
# "featureName" property - name of the feature
featureName=C/C++ Unit Testing Support
# "providerName" property - name of the company that provides the feature
providerName=Eclipse CDT
# "updateSiteName" property - label for the update site
updateSiteName=Eclipse CDT Update Site
# "description" property - description of the feature
description=Support for running unit tests
# copyright
copyright=\
Copyright (c) 2012 Anton Gorenkov and others.\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v1.0\n\
which accompanies this distribution, and is available at\n\
http://www.eclipse.org/legal/epl-v10.html
# "licenseURL" property - URL of the "Feature License"
# do not translate value - just change to point to a locale-specific HTML page
licenseURL=license.html
# "license" property - text of the "Feature Update License"
# should be plain text version of license agreement pointed to be "licenseURL"
license=\
Eclipse Foundation Software User Agreement\n\
February 1, 2011\n\
\n\
Usage Of Content\n\
\n\
THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
\n\
Applicable Licenses\n\
\n\
Unless otherwise indicated, all Content made available by the\n\
Eclipse Foundation is provided to you under the terms and conditions of\n\
the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
For purposes of the EPL, "Program" will mean the Content.\n\
\n\
Content includes, but is not limited to, source code, object code,\n\
documentation and other files maintained in the Eclipse Foundation source code\n\
repository ("Repository") in software modules ("Modules") and made available\n\
as downloadable archives ("Downloads").\n\
\n\
- Content may be structured and packaged into modules to facilitate delivering,\n\
extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
plug-in fragments ("Fragments"), and features ("Features").\n\
- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
in a directory named "plugins".\n\
- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
Each Feature may be packaged as a sub-directory in a directory named "features".\n\
Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- Features may also include other Features ("Included Features"). Within a Feature, files\n\
named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
\n\
The terms and conditions governing Plug-ins and Fragments should be\n\
contained in files named "about.html" ("Abouts"). The terms and\n\
conditions governing Features and Included Features should be contained\n\
in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
Licenses may be located in any directory of a Download or Module\n\
including, but not limited to the following locations:\n\
\n\
- The top-level (root) directory\n\
- Plug-in and Fragment directories\n\
- Inside Plug-ins and Fragments packaged as JARs\n\
- Sub-directories of the directory named "src" of certain Plug-ins\n\
- Feature directories\n\
\n\
Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
Update License") during the installation process. If the Feature contains\n\
Included Features, the Feature Update License should either provide you\n\
with the terms and conditions governing the Included Features or inform\n\
you where you can locate them. Feature Update Licenses may be found in\n\
the "license" property of files named "feature.properties" found within a Feature.\n\
Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
terms and conditions (or references to such terms and conditions) that\n\
govern your use of the associated Content in that directory.\n\
\n\
THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
\n\
- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
\n\
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
govern that particular Content.\n\
\n\
\n\Use of Provisioning Technology\n\
\n\
The Eclipse Foundation makes available provisioning software, examples of which include,\n\
but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
the purpose of allowing users to install software, documentation, information and/or\n\
other materials (collectively "Installable Software"). This capability is provided with\n\
the intent of allowing such users to install, extend and update Eclipse-based products.\n\
Information about packaging Installable Software is available at\n\
http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
\n\
You may use Provisioning Technology to allow other parties to install Installable Software.\n\
You shall be responsible for enabling the applicable license agreements relating to the\n\
Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
making it available in accordance with the Specification, you further acknowledge your\n\
agreement to, and the acquisition of all necessary rights to permit the following:\n\
\n\
1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
extending or updating the functionality of an Eclipse-based product.\n\
2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
govern the use of the Installable Software ("Installable Software Agreement") and such\n\
Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
with the Specification. Such Installable Software Agreement must inform the user of the\n\
terms and conditions that govern the Installable Software and must solicit acceptance by\n\
the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
indication of agreement by the user, the provisioning Technology will complete installation\n\
of the Installable Software.\n\
\n\
Cryptography\n\
\n\
Content may contain encryption software. The country in which you are\n\
currently may have restrictions on the import, possession, and use,\n\
and/or re-export to another country, of encryption software. BEFORE\n\
using any encryption software, please check the country's laws,\n\
regulations and policies concerning the import, possession, or use, and\n\
re-export of encryption software, to see if this is permitted.\n\
\n\
Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
########### end of license property ##########################################

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.eclipse.cdt.testsrunner.feature"
label="%featureName"
version="7.0.0.qualifier"
provider-name="%providerName">
<description>
%description
</description>
<copyright>
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
<url>
<update label="%updateSiteName" url="http://download.eclipse.org/tools/cdt/releases/indigo"/>
</url>
<plugin
id="org.eclipse.cdt.testsrunner"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.testsrunner.boost"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.testsrunner.gtest"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.testsrunner.qttest"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Eclipse Foundation Software User Agreement</title>
</head>
<body lang="EN-US">
<h2>Eclipse Foundation Software User Agreement</h2>
<p>February 1, 2011</p>
<h3>Usage Of Content</h3>
<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
(COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
<h3>Applicable Licenses</h3>
<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
(&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
<ul>
<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
and/or Fragments associated with that Feature.</li>
<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
</ul>
<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
including, but not limited to the following locations:</p>
<ul>
<li>The top-level (root) directory</li>
<li>Plug-in and Fragment directories</li>
<li>Inside Plug-ins and Fragments packaged as JARs</li>
<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
<li>Feature directories</li>
</ul>
<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
that directory.</p>
<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
<ul>
<li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
<li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
</ul>
<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
<h3>Use of Provisioning Technology</h3>
<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
(&quot;Specification&quot;).</p>
<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
<ol>
<li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
product.</li>
<li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
accessed and copied to the Target Machine.</li>
<li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
</ol>
<h3>Cryptography</h3>
<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
possession, or use, and re-export of encryption software, to see if this is permitted.</p>
<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
</body>
</html>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.cdt.features</groupId>
<version>7.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.testsrunner.feature</artifactId>
<packaging>eclipse-feature</packaging>
</project>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner.gtest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,82 @@
#Mon Apr 16 13:01:24 EEST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.testsrunner.gtest;singleton:=true
Bundle-Version: 7.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.testsrunner.internal.gtest.GoogleTestsRunnerPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.cdt.testsrunner;bundle-version="3.5.0"
Export-Package: org.eclipse.cdt.testsrunner.internal.gtest;x-friends:="org.eclipse.cdt.testsrunner.test"

View file

@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 22, 2007</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html>

View file

@ -0,0 +1,21 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
bin.includes = plugin.xml,\
plugin.properties,\
about.html,\
.,\
META-INF/
javadoc.packages = org.eclipse.cdt.launch.ui.*,\
org.eclipse.cdt.launch.sourcelookup*,\
org.eclipse.cdt.launch.*
source.. = src/
src.includes = about.html

View file

@ -0,0 +1,15 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
pluginName=C/C++ Development Tools Google Tests Runner Support
providerName=Eclipse CDT
GoogleTestsRunner.name=Google Tests Runner
GoogleTestsRunner.description=Tests runner for a test module based on Google C++ Testing Framework

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.cdt.testsrunner.TestsRunner">
<runner
class="org.eclipse.cdt.testsrunner.internal.gtest.GoogleTestsRunnerProvider"
description="%GoogleTestsRunner.description"
id="org.eclipse.cdt.testsrunner.gtest"
name="%GoogleTestsRunner.name">
<features
multipleTestFilter="true">
</features>
</runner>
</extension>
</plugin>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<version>7.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.testsrunner.gtest</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -0,0 +1,35 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov.
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.gtest;
import org.eclipse.osgi.util.NLS;
public class GoogleTestsRunnerMessages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.testsrunner.internal.gtest.GoogleTestsRunnerMessages"; //$NON-NLS-1$
public static String GoogleTestsRunner_error_format;
public static String GoogleTestsRunner_io_error_prefix;
public static String OutputHandler_getparam_message;
public static String OutputHandler_unexpected_case_end;
public static String OutputHandler_unexpected_output;
public static String OutputHandler_unexpected_suite_end;
public static String OutputHandler_unknown_error_prefix;
public static String OutputHandler_unknown_location_format;
public static String OutputHandler_unknown_test_status;
public static String OutputHandler_wrong_groups_count;
public static String OutputHandler_wrong_suite_name;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, GoogleTestsRunnerMessages.class);
}
private GoogleTestsRunnerMessages() {
}
}

View file

@ -0,0 +1,21 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
GoogleTestsRunner_error_format={0}: {1}
GoogleTestsRunner_io_error_prefix=I/O Error:
OutputHandler_getparam_message=Instantiated with GetParam() = {0}
OutputHandler_unexpected_case_end=End of test case "{0}" is not expected, because the last started case is "{1}".
OutputHandler_unexpected_output=Unexpected test module output.
OutputHandler_unexpected_suite_end=End of test suite "{0}" is not expected, because the last started suite is "{1}".
OutputHandler_unknown_error_prefix=Unknown error during parsing Google Test module output:
OutputHandler_unknown_location_format=Unknown location format.
OutputHandler_unknown_test_status=Test status value "{0}" is unknown.
OutputHandler_wrong_groups_count=State with pattern "{0}" should has {1} groups but has {2}.
OutputHandler_wrong_suite_name=A test case "{0}" belongs to test suite "{1}", but the last started suite is "{2}".

View file

@ -0,0 +1,67 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.gtest;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
/**
* The activator class controls the plug-in life cycle
*/
public class GoogleTestsRunnerPlugin extends Plugin {
/** The plug-in ID .*/
public static final String PLUGIN_ID = "org.eclipse.cdt.testsrunner.gtest"; //$NON-NLS-1$
/** Plug-in instance. */
private static GoogleTestsRunnerPlugin plugin;
public GoogleTestsRunnerPlugin() {
super();
plugin = this;
}
/**
* Returns the Boost Tests Runner provider plug-in instance.
*
* @return the plug-in instance
*/
public static GoogleTestsRunnerPlugin getDefault() {
return plugin;
}
/** Convenience method which returns the unique identifier of this plugin. */
public static String getUniqueIdentifier() {
return PLUGIN_ID;
}
/**
* Logs the specified status with this plug-in's log.
*
* @param status status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
/**
* Logs an internal error with the specified throwable
*
* @param e the exception to be logged
*/
public static void log(Throwable e) {
log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e));
}
}

View file

@ -0,0 +1,97 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.gtest;
import java.io.IOException;
import java.io.InputStream;
import java.text.MessageFormat;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.TestingException;
/**
* The Tests Runner provider plug-in to run tests with Google Testing framework.
*
* Parses the text test module to output and provides the data for the Tests
* Runner Plug-In.
*/
public class GoogleTestsRunnerProvider implements ITestsRunnerProvider {
private static final String TEST_PATHS_DELIMITED = ":"; //$NON-NLS-1$
private static final String TEST_PATH_PARTS_DELIMITED = "."; //$NON-NLS-1$
private static final String ALL_TESTS= ".*"; //$NON-NLS-1$
@Override
public String[] getAdditionalLaunchParameters(String[][] testPaths) {
final String[] gtestParameters = {
"--gtest_repeat=1", //$NON-NLS-1$
"--gtest_print_time=1", //$NON-NLS-1$
"--gtest_color=no", //$NON-NLS-1$
};
String[] result = gtestParameters;
// Build tests filter
if (testPaths != null && testPaths.length >= 1) {
StringBuilder sb = new StringBuilder("--gtest_filter="); //$NON-NLS-1$
boolean needTestPathDelimiter = false;
for (String[] testPath : testPaths) {
if (needTestPathDelimiter) {
sb.append(TEST_PATHS_DELIMITED);
} else {
needTestPathDelimiter = true;
}
boolean needTestPathPartDelimiter = false;
for (String testPathPart : testPath) {
if (needTestPathPartDelimiter) {
sb.append(TEST_PATH_PARTS_DELIMITED);
} else {
needTestPathPartDelimiter = true;
}
sb.append(testPathPart);
}
// If it is a test suite
if (testPath.length <= 1) {
sb.append(ALL_TESTS);
}
}
result = new String[gtestParameters.length + 1];
System.arraycopy(gtestParameters, 0, result, 0, gtestParameters.length);
result[gtestParameters.length] = sb.toString();
}
return result;
}
/**
* Construct the error message from prefix and detailed description.
*
* @param prefix prefix
* @param description detailed description
* @return the full message
*/
private String getErrorText(String prefix, String description) {
return MessageFormat.format(GoogleTestsRunnerMessages.GoogleTestsRunner_error_format, prefix, description);
}
@Override
public void run(ITestModelUpdater modelUpdater, InputStream inputStream) throws TestingException {
try {
OutputHandler ouputHandler = new OutputHandler(modelUpdater);
ouputHandler.run(inputStream);
} catch (IOException e) {
throw new TestingException(getErrorText(GoogleTestsRunnerMessages.GoogleTestsRunner_io_error_prefix, e.getLocalizedMessage()));
}
}
}

View file

@ -0,0 +1,645 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.gtest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
import org.eclipse.cdt.testsrunner.model.TestingException;
import org.xml.sax.SAXException;
/**
* <p>
* Parses the output of Google Testing Framework and notifies the Tests Runner
* Core about how the testing process is going.
* </p>
* <p>
* Unfortunately, gtest does not provide a realtime XML output (yes, it has XML
* output, but it is generated after testing process is done), so we have to
* parse its output that is less reliable.
* </p>
* <p>
* The parsing is done with a simple FSM (Final State Machine). There is an
* internal state that changes when input tokens (gtest output lines) come.
* There is a transitions table that is used to determine what is the next state
* depending on the current one and the input token. The state may define
* onEnter and onExit actions to do the useful job.
* </p>
*/
public class OutputHandler {
/**
* Base class for the FSM internal state.
*/
class State {
/** Stores the regular expression by which the state should be entered. */
private Pattern enterPattern;
/** The regular expression matcher. */
private Matcher matcher;
/** Groups count in a regular expression. */
private int groupCount;
/**
* The constructor.
*
* @param enterRegex the regular expression by which the state should be
* entered
*/
State(String enterRegex) {
this(enterRegex, -1);
}
/**
* The constructor.
*
* @param enterRegex the regular expression by which the state should be
* entered
* @param groupCount groups count in a regular expression. It is used
* just to make debug easier and the parser more reliable.
*/
State(String enterRegex, int groupCount) {
enterPattern = Pattern.compile(enterRegex);
this.groupCount = groupCount;
}
/**
* Checks whether the specified string matches the enter pattern
* (regular expression). If it is so the state should be entered.
*
* @param line input line (token)
* @return true if matches and false otherwise
* @throws TestingException if groups count does not match the defined
* in constructor number.
*/
public boolean match(String line) throws TestingException {
matcher = enterPattern.matcher(line);
boolean groupsCountOk = groupCount == -1 || matcher.groupCount() == groupCount;
if (!groupsCountOk) {
generateInternalError(
MessageFormat.format(
GoogleTestsRunnerMessages.OutputHandler_wrong_groups_count,
enterPattern.pattern(), matcher.groupCount(), groupCount
)
);
}
boolean matches = matcher.matches();
if (!matches || !groupsCountOk) {
// Do not keep the reference - it will be unnecessary anyway
matcher = null;
}
return matches;
}
/**
* Returns the matched group value by index.
*
* @param groupNumber group index
* @return group value
*/
protected String group(int groupNumber) {
return matcher.group(groupNumber);
}
/**
* Action that triggers on state enter.
*
* @param previousState previous state
* @throws TestingException if testing error is detected
*/
public void onEnter(State previousState) throws TestingException {}
/**
* Action that triggers on state exit.
*
* @param previousState next state
* @throws TestingException if testing error is detected
*/
public void onExit(State nextState) {}
/**
* Common routine that constructs full test suite name by name and type
* parameter.
*
* @param name test suite name
* @param typeParameter type parameter
* @return full test suite name
*/
protected String getTestSuiteName(String name, String typeParameter) {
return (typeParameter != null) ? MessageFormat.format("{0}({1})", name, typeParameter.trim()) : name; //$NON-NLS-1$
}
}
/**
* The state is activated when a new test suite is started.
*/
class TestSuiteStart extends State {
/** Stores the matched type parameter. */
private String typeParameter;
TestSuiteStart(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Stores type parameter and notify Tests Runner Core about test suite
* start.
*/
@Override
public void onEnter(State previousState) {
typeParameter = group(3);
modelUpdater.enterTestSuite(getTestSuiteName(group(1), typeParameter));
}
/**
* Provides access to the matched type parameter.
*
* @return type parameter value
*/
public String getTypeParameter() {
return typeParameter;
}
}
/**
* The state is activated when a new test case is started.
*/
class TestCaseStart extends State {
TestCaseStart(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Extract current test case and test suite names and notify Tests
* Runner Core about test case start.
*
* @throws TestingException if extracted test suite name does not match
* last entered test suite name.
*/
@Override
public void onEnter(State previousState) throws TestingException {
String testCaseName = group(2);
String lastTestSuiteName = modelUpdater.currentTestSuite().getName();
String currTestSuiteName = getTestSuiteName(group(1), stateTestSuiteStart.getTypeParameter());
if (!lastTestSuiteName.equals(currTestSuiteName)) {
generateInternalError(
MessageFormat.format(
GoogleTestsRunnerMessages.OutputHandler_wrong_suite_name,
testCaseName, currTestSuiteName, lastTestSuiteName
)
);
}
modelUpdater.enterTestCase(testCaseName);
}
}
/**
* The state is activated when an error message's location is started.
*/
class ErrorMessageLocation extends State {
/** Stores the message location file name. */
private String messageFileName;
/** Stores the message location line number. */
private int messageLineNumber;
/** Stores the first part of the message. */
private String messagePart;
ErrorMessageLocation(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Extract the data for the message location (file name, line number).
* The data may be provided in a common style ("/path/file:line" with
* the message text starting on the next line) or Visual Studio style
* ("/path/file(line):" with the message text continuing on the same
* line). It is also possible not to specify line number at all
* ("/path/file:").
*
* @throws TestingException if location format cannot be recognized.
*/
@Override
public void onEnter(State previousState) throws TestingException {
String fileNameIfLinePresent = group(2);
String fileNameIfLineAbsent = group(6);
String lineNumberCommon = group(4);
String lineNumberVS = group(5);
if (fileNameIfLinePresent != null) {
if (lineNumberCommon != null) {
messageFileName = fileNameIfLinePresent;
messageLineNumber = Integer.parseInt(lineNumberCommon.trim());
} else if (lineNumberVS != null) {
messageFileName = fileNameIfLinePresent;
messageLineNumber = Integer.parseInt(lineNumberVS.trim());
} else {
if (!modelUpdater.currentTestSuite().getName().equals(group(1))) {
generateInternalError(GoogleTestsRunnerMessages.OutputHandler_unknown_location_format);
}
}
} else if (fileNameIfLineAbsent != null) {
if (lineNumberCommon == null && lineNumberVS == null) {
messageFileName = fileNameIfLineAbsent;
messageLineNumber = DEFAULT_LOCATION_LINE;
} else {
generateInternalError(GoogleTestsRunnerMessages.OutputHandler_unknown_location_format);
}
}
// Check special case when file is not known - reset location
if (messageFileName.equals("unknown file")) { //$NON-NLS-1$
messageFileName = DEFAULT_LOCATION_FILE;
}
// NOTE: For Visual Studio style there is also first part of the message at this line
messagePart = group(8);
}
/**
* Provides access to the message location file name.
*
* @return file name
*/
public String getMessageFileName() {
return messageFileName;
}
/**
* Provides access to the message location line number.
*
* @return line number
*/
public int getMessageLineNumber() {
return messageLineNumber;
}
/**
* Provides access to the first part of the message.
*
* @return message part
*/
public String getMessagePart() {
return messagePart;
}
}
/**
* The state is activated when an error message text is started or continued.
*/
class ErrorMessage extends State {
/** Stores the error message text that was already read. */
private StringBuilder messagePart = new StringBuilder();
ErrorMessage(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Collects the error message parts into internal buffer. If the
* previous state is not the same (it should be
* stateErrorMessageLocation) - get the message part from it.
*/
@Override
public void onEnter(State previousState) {
boolean needEndOfLine = (this == previousState);
if (this != previousState) {
String firstMessagePart = stateErrorMessageLocation.getMessagePart();
if (firstMessagePart != null) {
messagePart.append(firstMessagePart);
needEndOfLine = true;
}
}
if (needEndOfLine) {
messagePart.append(System.getProperty("line.separator")); //$NON-NLS-1$
}
messagePart.append(group(1));
}
/**
* Notifies the Tests Runner Core about new test message.
*/
@Override
public void onExit(State nextState) {
if (this != nextState) {
modelUpdater.addTestMessage(
stateErrorMessageLocation.getMessageFileName(),
stateErrorMessageLocation.getMessageLineNumber(),
ITestMessage.Level.Error,
messagePart.toString()
);
messagePart.setLength(0);
}
}
}
/**
* The state is activated when a test trace is started or continued.
*/
class TestTrace extends ErrorMessageLocation {
TestTrace(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Notifies the Tests Runner Core about new test message with test trace
* info.
*/
@Override
public void onEnter(State previousState) throws TestingException {
super.onEnter(previousState);
modelUpdater.addTestMessage(
getMessageFileName(),
getMessageLineNumber(),
ITestMessage.Level.Info,
getMessagePart()
);
}
}
/**
* The state is activated when a test case is finished.
*/
class TestCaseEnd extends State {
TestCaseEnd(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Sets the test case execution time, status and notify Tests Runner
* Core about test case end.
*
* @throws TestingException if current test suite or case name does not
* match last entered test suite or case name or if test status is not
* known.
*/
@Override
public void onEnter(State previousState) throws TestingException {
String lastTestSuiteName = modelUpdater.currentTestSuite().getName();
String explicitTypeParameter = group(5);
String typeParameter = explicitTypeParameter != null ? explicitTypeParameter : stateTestSuiteStart.getTypeParameter();
String currTestSuiteName = getTestSuiteName(group(2), typeParameter);
if (!lastTestSuiteName.equals(currTestSuiteName)) {
generateInternalError(
MessageFormat.format(
GoogleTestsRunnerMessages.OutputHandler_wrong_suite_name,
group(2), currTestSuiteName, lastTestSuiteName
)
);
}
String lastTestCaseName = modelUpdater.currentTestCase().getName();
if (!lastTestCaseName.equals(group(3))) {
generateInternalError(
MessageFormat.format(
GoogleTestsRunnerMessages.OutputHandler_unexpected_case_end,
group(3), lastTestCaseName
)
);
}
String testStatusStr = group(1);
ITestItem.Status testStatus = ITestItem.Status.Skipped;
if (testStatusStr.equals(testStatusOk)) {
testStatus = ITestItem.Status.Passed;
} else if (testStatusStr.equals(testStatusFailed)) {
testStatus = ITestItem.Status.Failed;
} else {
generateInternalError(MessageFormat.format(GoogleTestsRunnerMessages.OutputHandler_unknown_test_status, testStatusStr));
}
String getParamValue = group(7);
if (getParamValue != null) {
modelUpdater.addTestMessage(
DEFAULT_LOCATION_FILE,
DEFAULT_LOCATION_LINE,
ITestMessage.Level.Info,
MessageFormat.format(GoogleTestsRunnerMessages.OutputHandler_getparam_message, getParamValue)
);
}
modelUpdater.setTestingTime(Integer.parseInt(group(8)));
modelUpdater.setTestStatus(testStatus);
modelUpdater.exitTestCase();
}
}
/**
* The state is activated when a test suite is finished.
*/
class TestSuiteEnd extends State {
TestSuiteEnd(String enterRegex, int groupCount) {
super(enterRegex, groupCount);
}
/**
* Notify Tests Runner Core about test suite end.
*
* @throws TestingException if current test suite name does not match
* last entered test suite name.
*/
@Override
public void onEnter(State previousState) throws TestingException {
String lastTestSuiteName = modelUpdater.currentTestSuite().getName();
String currTestSuiteName = getTestSuiteName(group(1), stateTestSuiteStart.getTypeParameter());
if (!lastTestSuiteName.equals(currTestSuiteName)) {
generateInternalError(
MessageFormat.format(
GoogleTestsRunnerMessages.OutputHandler_unexpected_suite_end,
currTestSuiteName, lastTestSuiteName
)
);
}
modelUpdater.exitTestSuite();
}
}
/** The default file name for test message location. */
private static final String DEFAULT_LOCATION_FILE = null;
/** The default line number for test message location. */
private static final int DEFAULT_LOCATION_LINE = 1;
// Common regular expression parts
static private String regexTestSuiteName = "([^,]+)"; //$NON-NLS-1$
static private String regexParameterInstantiation = "(\\s*,\\s+where\\s+TypeParam\\s*=([^,(]+))?"; //$NON-NLS-1$
static private String regexTestName = regexTestSuiteName+"\\.([^,]+)"; //$NON-NLS-1$
static private String regexTestCount = "\\d+\\s+tests?"; //$NON-NLS-1$
static private String regexTestTime = "(\\d+)\\s+ms"; //$NON-NLS-1$
/* Matches location in the following formats:
* - /file:line:
* - /file(line):
* - /file: (with no line number specified)
* Groups:
* 1 - all except ":"
* 2 - file name (if line present) *
* 3 - line number with delimiters
* 4 - line number (common style) *
* 5 - line number (Visual Studio style) *
* 6 - file name (if no line number specified) *
* Using:
* - group 2 with 4 or 5 (if line number was specified)
* - group 6 (if filename only was specified)
*/
static private String regexLocation = "((.*)(:(\\d+)|\\((\\d+)\\))|(.*[^):])):"; //$NON-NLS-1$
// Test statuses representation
static private String testStatusOk = "OK"; //$NON-NLS-1$
static private String testStatusFailed = "FAILED"; //$NON-NLS-1$
// All available states in FSM
private State stateInitial = new State(""); //$NON-NLS-1$
private State stateInitialized = new State(".*Global test environment set-up.*"); //$NON-NLS-1$
private TestSuiteStart stateTestSuiteStart = new TestSuiteStart("\\[-*\\]\\s+"+regexTestCount+"\\s+from\\s+"+regexTestSuiteName+regexParameterInstantiation, 3); //$NON-NLS-1$ //$NON-NLS-2$
private State stateTestCaseStart = new TestCaseStart("\\[\\s*RUN\\s*\\]\\s+"+regexTestName, 2); //$NON-NLS-1$
private ErrorMessageLocation stateErrorMessageLocation = new ErrorMessageLocation(regexLocation+"\\s+(Failure|error: (.*))", 8); //$NON-NLS-1$
private State stateErrorMessage = new ErrorMessage("(.*)", 1); //$NON-NLS-1$
private State stateTestTraceStart = new State(".*Google Test trace.*"); //$NON-NLS-1$
// NOTE: Use 8 groups instead of 7 cause we need to be consistent with ErrorMessageLocation (as we subclass it)
private State stateTestTrace = new TestTrace(regexLocation+"\\s+((.*))", 8); //$NON-NLS-1$
private State stateTestCaseEnd = new TestCaseEnd("\\[\\s*("+testStatusOk+"|"+testStatusFailed+")\\s*\\]\\s+"+regexTestName+regexParameterInstantiation+"(\\s*,\\s+where\\s+GetParam\\s*\\(\\s*\\)\\s*=\\s*(.+))?\\s+\\("+regexTestTime+"\\)", 8); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
private State stateTestSuiteEnd = new TestSuiteEnd("\\[-*\\]\\s+"+regexTestCount+"\\s+from\\s+"+regexTestSuiteName+"\\s+\\("+regexTestTime+"\\s+total\\)", 2); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
private State stateFinal = new State(".*Global test environment tear-down.*"); //$NON-NLS-1$
// NOTE: This state is a special workaround for empty test modules (they haven't got global test environment set-up/tear-down). They should be always passed.
private State stateEmptyTestModuleFinal = new State(".*\\[\\s*PASSED\\s*\\]\\s+0\\s+tests.*"); //$NON-NLS-1$
// Transitions table
private Map<State, State[] > transitions = new HashMap<State, State[]>();
{
// NOTE: Next states order is important!
transitions.put( from(stateInitial), to(stateInitialized, stateEmptyTestModuleFinal) );
transitions.put( from(stateInitialized), to(stateTestSuiteStart) );
transitions.put( from(stateTestSuiteStart), to(stateTestCaseStart) );
transitions.put( from(stateTestCaseStart), to(stateTestCaseEnd, stateErrorMessageLocation) );
transitions.put( from(stateErrorMessageLocation), to(stateTestTraceStart, stateTestCaseEnd, stateErrorMessageLocation, stateErrorMessage) );
transitions.put( from(stateErrorMessage), to(stateTestTraceStart, stateTestCaseEnd, stateErrorMessageLocation, stateErrorMessage) );
transitions.put( from(stateTestTraceStart), to(stateTestTrace) );
transitions.put( from(stateTestTrace), to(stateTestCaseEnd, stateErrorMessageLocation, stateTestTrace) );
transitions.put( from(stateTestCaseEnd), to(stateTestCaseStart, stateTestSuiteEnd) );
transitions.put( from(stateTestSuiteEnd), to(stateTestSuiteStart, stateFinal) );
}
/** Current FSM state. */
private State currentState;
/** The interface to notify the Tests Runner Core */
private ITestModelUpdater modelUpdater;
OutputHandler(ITestModelUpdater modelUpdater) {
this.modelUpdater = modelUpdater;
}
/**
* Runs the parsing process. Initializes the FSM, selects new states with
* transitions table and checks whether the parsing completes successfully.
*
* @param inputStream gtest test module output stream
* @throws IOException if stream reading error happens
* @throws TestingException if testing error happens
*/
public void run(InputStream inputStream) throws IOException, TestingException {
// Initialize input stream reader
InputStreamReader streamReader = new InputStreamReader(inputStream);
BufferedReader reader = new BufferedReader(streamReader);
String line;
boolean finalizedProperly = false;
// Initialize internal state
currentState = stateInitial;
while ( ( line = reader.readLine() ) != null ) {
// Search for the next possible state
State[] possibleNextStates = transitions.get(currentState);
if (possibleNextStates == null) {
// Final state, stop running
finalizedProperly = true;
break;
}
for (State nextState : possibleNextStates) {
if (nextState.match(line)) {
// Next state found - send notifications to the states
currentState.onExit(nextState);
State previousState = currentState;
currentState = nextState;
nextState.onEnter(previousState);
break;
}
}
// NOTE: We cannot be sure that we cover all the output of gtest with our regular expressions
// (e.g. some framework notes or warnings may be uncovered etc.), so we just skip unmatched
// lines without an error
}
// Check whether the last line leads to the final state
if (transitions.get(currentState) == null) {
finalizedProperly = true;
}
if (!finalizedProperly) {
generateInternalError(GoogleTestsRunnerMessages.OutputHandler_unexpected_output);
}
}
/**
* Throws the testing exception with unknown internal error prefix and the specified description.
*
* @param additionalInfo additional description of what happens
* @throws SAXException the exception that will be thrown
*/
private void generateInternalError(String additionalInfo) throws TestingException {
TestingException e = new TestingException(GoogleTestsRunnerMessages.OutputHandler_unknown_error_prefix+additionalInfo);
GoogleTestsRunnerPlugin.log(e);
throw e;
}
/**
* Helper functions to make code more readable.
*
* @param fromState state to return
* @return passed state
*/
private State from(State fromState) {
return fromState;
}
/**
* Helper functions to make code more readable.
*
* @param toStates states array to return
* @return passed states array
*/
private State[] to(State... toStates) {
return toStates;
}
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner.qttest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,82 @@
#Mon Apr 16 13:01:24 EEST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.testsrunner.qttest;singleton:=true
Bundle-Version: 7.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.testsrunner.internal.qttest.QtTestsRunnerPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.cdt.testsrunner;bundle-version="3.5.0"
Export-Package: org.eclipse.cdt.testsrunner.internal.qttest;x-friends:="org.eclipse.cdt.testsrunner.test"

View file

@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 22, 2007</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html>

View file

@ -0,0 +1,21 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
bin.includes = plugin.xml,\
plugin.properties,\
about.html,\
.,\
META-INF/
javadoc.packages = org.eclipse.cdt.launch.ui.*,\
org.eclipse.cdt.launch.sourcelookup*,\
org.eclipse.cdt.launch.*
source.. = src/
src.includes = about.html

View file

@ -0,0 +1,15 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
pluginName=C/C++ Development Tools Qt Tests Runner Support
providerName=Eclipse CDT
QtTestsRunner.name=Qt Tests Runner
QtTestsRunner.description=Tests runner for a test module based on Qt4 Testing framework

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.cdt.testsrunner.TestsRunner">
<runner
class="org.eclipse.cdt.testsrunner.internal.qttest.QtTestsRunnerProvider"
description="%QtTestsRunner.description"
id="org.eclipse.cdt.testsrunner.qttest"
name="%QtTestsRunner.name">
<features
multipleTestFilter="true"
testingTimeMeasurement="true">
</features>
</runner>
</extension>
</plugin>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<version>7.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.testsrunner.qttest</artifactId>
<packaging>eclipse-plugin</packaging>
</project>

View file

@ -0,0 +1,37 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov.
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.qttest;
import org.eclipse.osgi.util.NLS;
public class QtTestsRunnerMessages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.testsrunner.internal.qttest.QtTestsRunnerMessages"; //$NON-NLS-1$
public static String QtTestsRunner_error_format;
public static String QtTestsRunner_io_error_prefix;
public static String QtTestsRunner_no_test_cases_to_rerun;
public static String QtTestsRunner_xml_error_prefix;
public static String QtXmlLogHandler_benchmark_result_message;
public static String QtXmlLogHandler_datatag_format;
public static String QtXmlLogHandler_metrics_unit_events;
public static String QtXmlLogHandler_metrics_unit_instructions;
public static String QtXmlLogHandler_metrics_unit_msec;
public static String QtXmlLogHandler_metrics_unit_ticks;
public static String QtXmlLogHandler_unknown_benchmarck_metric;
public static String QtXmlLogHandler_unknown_message_level;
public static String QtXmlLogHandler_wrong_tag_name;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, QtTestsRunnerMessages.class);
}
private QtTestsRunnerMessages() {
}
}

View file

@ -0,0 +1,23 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
QtTestsRunner_error_format={0}: {1}
QtTestsRunner_io_error_prefix=I/O Error:
QtTestsRunner_no_test_cases_to_rerun=There is no test cases to rerun (initialization and finalization test cases are not taken into account)
QtTestsRunner_xml_error_prefix=XML parse error:
QtXmlLogHandler_benchmark_result_message={0,number,\#.\#\#\#\#} {1} per iteration (total: {2}, iterations: {3})
QtXmlLogHandler_datatag_format=({0})
QtXmlLogHandler_metrics_unit_events=events
QtXmlLogHandler_metrics_unit_instructions=instr.
QtXmlLogHandler_metrics_unit_msec=msec
QtXmlLogHandler_metrics_unit_ticks=ticks
QtXmlLogHandler_unknown_benchmarck_metric=Benchmarck metric value "{0}" is not supported\!
QtXmlLogHandler_unknown_message_level=String "{0}" cannot be converted to a message level\!
QtXmlLogHandler_wrong_tag_name=Invalid XML format: Element "{0}" is not accepted\!

View file

@ -0,0 +1,66 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.qttest;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
/**
* The activator class controls the plug-in life cycle
*/
public class QtTestsRunnerPlugin extends Plugin {
/** The plug-in ID .*/
public static final String PLUGIN_ID = "org.eclipse.cdt.testsrunner.qttest"; //$NON-NLS-1$
/** Plug-in instance. */
private static QtTestsRunnerPlugin plugin;
public QtTestsRunnerPlugin() {
super();
plugin = this;
}
/**
* Returns the Qt Tests Runner provider plug-in instance.
*
* @return the plug-in instance
*/
public static QtTestsRunnerPlugin getDefault() {
return plugin;
}
/** Convenience method which returns the unique identifier of this plugin. */
public static String getUniqueIdentifier() {
return PLUGIN_ID;
}
/**
* Logs the specified status with this plug-in's log.
*
* @param status status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
/**
* Logs an internal error with the specified throwable
*
* @param e the exception to be logged
*/
public static void log(Throwable e) {
log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e));
}
}

View file

@ -0,0 +1,129 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.qttest;
import java.io.IOException;
import java.io.InputStream;
import java.text.MessageFormat;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.TestingException;
import org.xml.sax.SAXException;
/**
* The Tests Runner provider plug-in to run tests with Qt Test library.
*
* Configures the test module to output in XML format, parses the output and
* provides the data for the Tests Runner Plug-in.
*/
public class QtTestsRunnerProvider implements ITestsRunnerProvider {
/**
* Checks whether the specified path is "special" one ("initTestCase" or
* "cleanupTestCase").
*
* @param testPath test path to check
* @return true if the path is special and false otherwise
*/
private boolean isSpecialTestPath(String[] testPath) {
// Root test suite should not be explicitly specified for rerun
if (testPath.length <= 1) {
return true;
}
// "initTestCase" & "cleanupTestCase" are special test case names and they should be skipped too
String testName = testPath[testPath.length-1];
return testName.equals("initTestCase") || testName.equals("cleanupTestCase"); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* Returns the count of not "special" test paths.
*
* @param testPaths test paths array
* @return the count
* @see isSpecialTestPath()
*/
private int getNonSpecialTestsCount(String[][] testPaths) {
int result = 0;
for (int i = 0; i < testPaths.length; i++) {
String[] testPath = testPaths[i];
result += isSpecialTestPath(testPath) ? 0 : 1;
}
return result;
}
@Override
public String[] getAdditionalLaunchParameters(String[][] testPaths) throws TestingException {
final String[] qtParameters = {
"-xml", //$NON-NLS-1$
"-flush", //$NON-NLS-1$
};
String[] result = qtParameters;
if (testPaths != null) {
int testPathsLength = getNonSpecialTestsCount(testPaths);
// If there are only special test cases specified
if ((testPathsLength == 0) != (testPaths.length == 0)) {
throw new TestingException(QtTestsRunnerMessages.QtTestsRunner_no_test_cases_to_rerun);
}
// Build tests filter
if (testPathsLength >= 1) {
result = new String[qtParameters.length + testPathsLength];
System.arraycopy(qtParameters, 0, result, 0, qtParameters.length);
int resultIdx = qtParameters.length;
for (int i = 0; i < testPaths.length; i++) {
String[] testPath = testPaths[i];
if (!isSpecialTestPath(testPath)) {
result[resultIdx] = testPath[testPath.length-1];
resultIdx++;
}
}
}
}
return result;
}
/**
* Construct the error message from prefix and detailed description.
*
* @param prefix prefix
* @param description detailed description
* @return the full message
*/
private String getErrorText(String prefix, String description) {
return MessageFormat.format(QtTestsRunnerMessages.QtTestsRunner_error_format, prefix, description);
}
@Override
public void run(ITestModelUpdater modelUpdater, InputStream inputStream) throws TestingException {
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
sp.parse(inputStream, new QtXmlLogHandler(modelUpdater));
} catch (IOException e) {
throw new TestingException(getErrorText(QtTestsRunnerMessages.QtTestsRunner_io_error_prefix, e.getLocalizedMessage()));
} catch (ParserConfigurationException e) {
throw new TestingException(getErrorText(QtTestsRunnerMessages.QtTestsRunner_xml_error_prefix, e.getLocalizedMessage()));
} catch (SAXException e) {
throw new TestingException(getErrorText(QtTestsRunnerMessages.QtTestsRunner_xml_error_prefix, e.getLocalizedMessage()));
}
}
}

View file

@ -0,0 +1,399 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.internal.qttest;
import java.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestMessage.Level;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.ITestCase;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
* Parses the Qt Test XML log and notifies the Tests Runner Core about how the
* testing process is going.
*
* @note There is a terminology conflict between Qt Test library and Test
* Runner. Qt Test's "test case" is a "test suite" in Test Runner's terminology,
* Qt's "test function" is a "test case", the "incident" and "message" are
* "test messages". Be careful with it!
*/
public class QtXmlLogHandler extends DefaultHandler {
// Qt Test XML log tags
private static final String XML_NODE_TEST_CASE = "TestCase"; //$NON-NLS-1$
private static final String XML_NODE_TEST_FUNCTION = "TestFunction"; //$NON-NLS-1$
private static final String XML_NODE_INCIDENT = "Incident"; //$NON-NLS-1$
private static final String XML_NODE_MESSAGE = "Message"; //$NON-NLS-1$
private static final String XML_NODE_DESCRIPTION = "Description"; //$NON-NLS-1$
private static final String XML_NODE_ENVIRONMENT = "Environment"; //$NON-NLS-1$
private static final String XML_NODE_QTVERSION = "QtVersion"; //$NON-NLS-1$
private static final String XML_NODE_QTESTVERSION = "QTestVersion"; //$NON-NLS-1$
private static final String XML_NODE_BENCHMARK = "BenchmarkResult"; //$NON-NLS-1$
private static final String XML_NODE_DATATAG = "DataTag"; //$NON-NLS-1$
// Qt Test XML case statuses representation
private static final String XML_VALUE_INCIDENT_PASS = "pass"; //$NON-NLS-1$
private static final String XML_VALUE_INCIDENT_XFAIL = "xfail"; //$NON-NLS-1$
private static final String XML_VALUE_INCIDENT_FAIL = "fail"; //$NON-NLS-1$
private static final String XML_VALUE_INCIDENT_XPASS = "xpass"; //$NON-NLS-1$
private static final String XML_VALUE_INCIDENT_UNKNOWN = "??????"; //$NON-NLS-1$
// Qt Test XML log message levels representation
private static final String XML_VALUE_MESSAGE_WARN = "warn"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_SYSTEM = "system"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_QDEBUG = "qdebug"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_QWARN = "qwarn"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_QFATAL = "qfatal"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_SKIP = "skip"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_INFO = "info"; //$NON-NLS-1$
private static final String XML_VALUE_MESSAGE_UNKNOWN = "??????"; //$NON-NLS-1$
// Qt Test XML log attributes
private static final String XML_ATTR_TEST_CASE_NAME = "name"; //$NON-NLS-1$
private static final String XML_ATTR_TEST_FUNCTION_NAME = "name"; //$NON-NLS-1$
private static final String XML_ATTR_TYPE = "type"; //$NON-NLS-1$
private static final String XML_ATTR_FILE = "file"; //$NON-NLS-1$
private static final String XML_ATTR_LINE = "line"; //$NON-NLS-1$
private static final String XML_ATTR_BENCHMARK_METRIC = "metric"; //$NON-NLS-1$
private static final String XML_ATTR_BENCHMARK_VALUE = "value"; //$NON-NLS-1$
private static final String XML_ATTR_BENCHMARK_ITERATIONS = "iterations"; //$NON-NLS-1$
private static final String XML_ATTR_DATA_TAG = "tag"; //$NON-NLS-1$
/** Maps the string message level representation to the Tests Runner internal enum code. */
private static final Map<String, ITestMessage.Level> STRING_TO_MESSAGE_LEVEL;
static {
Map<String, ITestMessage.Level> aMap = new HashMap<String, ITestMessage.Level>();
aMap.put(XML_VALUE_MESSAGE_WARN, ITestMessage.Level.Warning);
aMap.put(XML_VALUE_MESSAGE_SYSTEM, ITestMessage.Level.Message);
aMap.put(XML_VALUE_MESSAGE_QDEBUG, ITestMessage.Level.Message);
aMap.put(XML_VALUE_MESSAGE_QWARN, ITestMessage.Level.Warning);
aMap.put(XML_VALUE_MESSAGE_QFATAL, ITestMessage.Level.FatalError);
aMap.put(XML_VALUE_MESSAGE_SKIP, ITestMessage.Level.Info);
aMap.put(XML_VALUE_MESSAGE_INFO, ITestMessage.Level.Info);
aMap.put(XML_VALUE_MESSAGE_UNKNOWN, ITestMessage.Level.FatalError);
// NOTE: Exception node is processed separately
STRING_TO_MESSAGE_LEVEL = Collections.unmodifiableMap(aMap);
}
/** Maps the string incident status representation to the test case status. */
private static final Map<String, ITestCase.Status> STRING_TO_TEST_STATUS;
static {
Map<String, ITestCase.Status> aMap = new HashMap<String, ITestCase.Status>();
aMap.put(XML_VALUE_INCIDENT_PASS, ITestCase.Status.Passed);
aMap.put(XML_VALUE_INCIDENT_XFAIL, ITestCase.Status.Failed);
aMap.put(XML_VALUE_INCIDENT_FAIL, ITestCase.Status.Failed);
aMap.put(XML_VALUE_INCIDENT_XPASS, ITestCase.Status.Failed);
aMap.put(XML_VALUE_INCIDENT_UNKNOWN, ITestCase.Status.Aborted);
// NOTE: Exception node is processed separately
STRING_TO_TEST_STATUS = Collections.unmodifiableMap(aMap);
}
/** Maps the string incident status representation to the test message level to log about it. */
private static final Map<String, ITestMessage.Level> STRING_INCIDENT_TO_MESSAGE_LEVEL;
static {
Map<String, ITestMessage.Level> aMap = new HashMap<String, ITestMessage.Level>();
aMap.put(XML_VALUE_INCIDENT_PASS, ITestMessage.Level.Info);
aMap.put(XML_VALUE_INCIDENT_XFAIL, ITestMessage.Level.Error);
aMap.put(XML_VALUE_INCIDENT_FAIL, ITestMessage.Level.FatalError);
aMap.put(XML_VALUE_INCIDENT_XPASS, ITestMessage.Level.Error);
aMap.put(XML_VALUE_INCIDENT_UNKNOWN, ITestMessage.Level.FatalError);
// NOTE: Exception node is processed separately
STRING_INCIDENT_TO_MESSAGE_LEVEL = Collections.unmodifiableMap(aMap);
}
/** Maps the metrics unit ids to the user readable names. */
private static final Map<String, String> XML_METRICS_TO_UNIT_NAME;
static {
Map<String,String> aMap = new HashMap<String, String>();
aMap.put("events", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_events); //$NON-NLS-1$
aMap.put("callgrind", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_instructions); //$NON-NLS-1$
aMap.put("walltime", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_msec); //$NON-NLS-1$
aMap.put("cputicks", QtTestsRunnerMessages.QtXmlLogHandler_metrics_unit_ticks); //$NON-NLS-1$
// NOTE: Exception node is processed separately
XML_METRICS_TO_UNIT_NAME = Collections.unmodifiableMap(aMap);
}
/** The interface to notify the Tests Runner Core */
private ITestModelUpdater modelUpdater;
/** Stores the text between current XML tag. */
private String elementData;
/** Stores the text for currently parsed test message. */
private String messageText;
/** Stores the file name part of location for currently parsed test message. */
private String fileName;
/** Stores the line number part of location for currently parsed test message. */
private int lineNumber;
/** Stores the message level for currently parsed test message. */
private ITestMessage.Level messageLevel;
/** Stores the status for currently parsed test case. */
private ITestItem.Status testCaseStatus;
/** Stores the name for currently parsed test case. */
private String testCaseName;
/** Stores the currently parsing data tag. */
private String currentDataTag;
/** Stores the last parsed data tag. */
private String lastDataTag;
/** Stores whether the test case was already added (means Tests Runner Core notified). */
private boolean testCaseAdded;
QtXmlLogHandler(ITestModelUpdater modelUpdater) {
this.modelUpdater = modelUpdater;
}
/**
* Notifies about test case exiting (if it was entered).
*/
private void exitTestCaseIfNecessary() {
if (testCaseAdded) {
modelUpdater.setTestStatus(testCaseStatus);
modelUpdater.exitTestCase();
testCaseAdded = false;
}
}
/**
* Creates a new test case if a new data tag is met.
*/
private void createTestCaseIfNecessary() {
if (!lastDataTag.equals(currentDataTag)) {
exitTestCaseIfNecessary();
currentDataTag = lastDataTag;
String suffix = !currentDataTag.isEmpty() ? MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_datatag_format, currentDataTag) : ""; //$NON-NLS-1$
modelUpdater.enterTestCase(testCaseName+suffix);
testCaseAdded = true;
}
}
/**
* Adds a new test message if there is a text for it.
*/
private void addTestMessageIfNecessary() {
if (messageText != null) {
modelUpdater.addTestMessage(fileName, lineNumber, messageLevel, messageText);
}
}
/**
* Sets a new status for the currently parsing test case.
*
* @param newStatus new test status
*
* @note Passed status is set by default and should not be set explicitly.
* But in case of errors it should not override Failed or Skipped statuses.
*/
private void setCurrentTestCaseStatus(ITestItem.Status newStatus) {
// Passed status is set by default and should not be set explicitly.
// But in case of errors it should not override Failed or Skipped statuses.
if (newStatus != ITestItem.Status.Passed) {
testCaseStatus = newStatus;
}
}
/**
* Converts the metric unit ids to user readable names.
*
* @param benchmarkMetric metric unit id
* @return user readable name
* @throws SAXException if metric unit id is not known
*/
private String getUnitsByBenchmarkMetric(String benchmarkMetric) throws SAXException {
String units = XML_METRICS_TO_UNIT_NAME.get(benchmarkMetric);
if (units == null) {
logAndThrowError(MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_unknown_benchmarck_metric, benchmarkMetric));
}
return units;
}
/**
* Converts the message level string to the internal enumeration core.
*
* @param map map to use
* @param incidentTypeStr message level string
* @return message level code
* @throws SAXException if message level string is not known
*/
private ITestMessage.Level getMessageLevel(Map<String, ITestMessage.Level> map, String incidentTypeStr) throws SAXException {
Level result = map.get(incidentTypeStr);
if (result == null) {
logAndThrowError(MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_unknown_message_level, incidentTypeStr));
}
return result;
}
@Override
public void startElement(String namespaceURI, String localName, String qName, Attributes attrs) throws SAXException {
elementData = null;
if (qName == XML_NODE_TEST_CASE) {
// NOTE: Terminology mapping: Qt Test Case is actually a Test Suite
String testSuiteName = attrs.getValue(XML_ATTR_TEST_CASE_NAME);
modelUpdater.enterTestSuite(testSuiteName);
} else if (qName == XML_NODE_TEST_FUNCTION) {
// NOTE: Terminology mapping: Qt Test Function is actually a Test Case
testCaseName = attrs.getValue(XML_ATTR_TEST_FUNCTION_NAME);
currentDataTag = null;
lastDataTag = ""; //$NON-NLS-1$
testCaseAdded = false;
testCaseStatus = ITestItem.Status.Passed;
} else if (qName == XML_NODE_MESSAGE) {
String messageLevelStr = attrs.getValue(XML_ATTR_TYPE);
fileName = attrs.getValue(XML_ATTR_FILE);
lineNumber = Integer.parseInt(attrs.getValue(XML_ATTR_LINE).trim());
messageLevel = getMessageLevel(STRING_TO_MESSAGE_LEVEL, messageLevelStr);
messageText = null;
if (messageLevelStr.equals(XML_VALUE_MESSAGE_SKIP)) {
setCurrentTestCaseStatus(ITestCase.Status.Skipped);
}
} else if (qName == XML_NODE_INCIDENT) {
String strType = attrs.getValue(XML_ATTR_TYPE);
fileName = attrs.getValue(XML_ATTR_FILE);
lineNumber = Integer.parseInt(attrs.getValue(XML_ATTR_LINE).trim());
messageLevel = getMessageLevel(STRING_INCIDENT_TO_MESSAGE_LEVEL, strType);
messageText = null;
setCurrentTestCaseStatus(STRING_TO_TEST_STATUS.get(strType));
} else if (qName == XML_NODE_BENCHMARK) {
lastDataTag = attrs.getValue(XML_ATTR_DATA_TAG);
createTestCaseIfNecessary();
int benchmarkResultIteratations = Integer.parseInt(attrs.getValue(XML_ATTR_BENCHMARK_ITERATIONS).trim());
float benchmarkResultValue = Integer.parseInt(attrs.getValue(XML_ATTR_BENCHMARK_VALUE).trim());
String units = getUnitsByBenchmarkMetric(attrs.getValue(XML_ATTR_BENCHMARK_METRIC).trim());
modelUpdater.addTestMessage("", 0, ITestMessage.Level.Info, //$NON-NLS-1$
MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_benchmark_result_message,
benchmarkResultValue/benchmarkResultIteratations, units, benchmarkResultValue, benchmarkResultIteratations
)
);
} else if (qName == XML_NODE_DATATAG) {
lastDataTag = ""; //$NON-NLS-1$
} else if (qName == XML_NODE_DESCRIPTION
|| qName == XML_NODE_ENVIRONMENT
|| qName == XML_NODE_QTVERSION
|| qName == XML_NODE_QTESTVERSION) {
/* just skip, do nothing */
} else {
logAndThrowErrorForElement(qName);
}
}
@Override
public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
if (qName == XML_NODE_TEST_CASE) {
modelUpdater.exitTestSuite();
} else if (qName == XML_NODE_TEST_FUNCTION) {
createTestCaseIfNecessary();
exitTestCaseIfNecessary();
} else if (qName == XML_NODE_DATATAG) {
lastDataTag = elementData;
} else if (qName == XML_NODE_INCIDENT) {
createTestCaseIfNecessary();
addTestMessageIfNecessary();
} else if (qName == XML_NODE_MESSAGE) {
createTestCaseIfNecessary();
addTestMessageIfNecessary();
} else if (qName == XML_NODE_DESCRIPTION) {
messageText = elementData == null || elementData.isEmpty() ? "" : elementData; //$NON-NLS-1$
} else if (qName == XML_NODE_ENVIRONMENT
|| qName == XML_NODE_QTVERSION
|| qName == XML_NODE_QTESTVERSION
|| qName == XML_NODE_BENCHMARK) {
/* just skip, do nothing */
} else {
logAndThrowErrorForElement(qName);
}
elementData = null;
}
@Override
public void characters(char[] ch, int start, int length) {
StringBuilder sb = new StringBuilder();
for (int i = start; i < start + length; i++) {
sb.append(ch[i]);
}
elementData = sb.toString();
}
/**
* Throws the testing exception for the specified XML tag.
*
* @param tagName XML tag name
* @throws SAXException the exception that will be thrown
*/
private void logAndThrowErrorForElement(String tagName) throws SAXException {
logAndThrowError(
MessageFormat.format(QtTestsRunnerMessages.QtXmlLogHandler_wrong_tag_name, tagName)
);
}
/**
* Throws the testing exception with the specified message.
*
* @param message the reason
* @throws SAXException the exception that will be thrown
*/
private void logAndThrowError(String message) throws SAXException {
SAXException e = new SAXException(message);
QtTestsRunnerPlugin.log(e);
throw e;
}
@Override
public void warning(SAXParseException ex) throws SAXException {
QtTestsRunnerPlugin.log(ex);
}
@Override
public void error(SAXParseException ex) throws SAXException {
QtTestsRunnerPlugin.log(ex);
throw ex;
}
@Override
public void fatalError(SAXParseException ex) throws SAXException {
QtTestsRunnerPlugin.log(ex);
throw ex;
}
}

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner.source.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,5 @@
bin.includes = feature.xml,\
eclipse_update_120.jpg,\
epl-v10.html,\
feature.properties,\
license.html

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -0,0 +1,328 @@
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List
href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
<title>Eclipse Public License - Version 1.0</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>2</o:Revision>
<o:TotalTime>3</o:TotalTime>
<o:Created>2004-03-05T23:03:00Z</o:Created>
<o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
<o:Pages>4</o:Pages>
<o:Words>1626</o:Words>
<o:Characters>9270</o:Characters>
<o:Lines>77</o:Lines>
<o:Paragraphs>18</o:Paragraphs>
<o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
<o:Version>9.4402</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:TrackRevisions/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{margin-right:0in;
mso-margin-top-alt:auto;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.BalloonText, li.BalloonText, div.BalloonText
{mso-style-name:"Balloon Text";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
font-family:Tahoma;
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
</p>
<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
OF THIS AGREEMENT.</span> </p>
<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
in the case of the initial Contributor, the initial code and documentation
distributed under this Agreement, and<br clear=left>
b) in the case of each subsequent Contributor:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
changes to the Program, and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
additions to the Program;</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
such changes and/or additions to the Program originate from and are distributed
by that particular Contributor. A Contribution 'originates' from a Contributor
if it was added to the Program by such Contributor itself or anyone acting on
such Contributor's behalf. Contributions do not include additions to the
Program which: (i) are separate modules of software distributed in conjunction
with the Program under their own license agreement, and (ii) are not derivative
works of the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
entity that distributes the Program.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
claims licensable by a Contributor which are necessarily infringed by the use
or sale of its Contribution alone or when combined with the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
distributed in accordance with this Agreement.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
receives the Program under this Agreement, including all Contributors.</span> </p>
<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
Subject to the terms of this Agreement, each Contributor hereby grants Recipient
a non-exclusive, worldwide, royalty-free copyright license to<span
style='color:red'> </span>reproduce, prepare derivative works of, publicly
display, publicly perform, distribute and sublicense the Contribution of such
Contributor, if any, and such derivative works, in source code and object code
form.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
patent license under Licensed Patents to make, use, sell, offer to sell, import
and otherwise transfer the Contribution of such Contributor, if any, in source
code and object code form. This patent license shall apply to the combination
of the Contribution and the Program if, at the time the Contribution is added
by the Contributor, such addition of the Contribution causes such combination
to be covered by the Licensed Patents. The patent license shall not apply to
any other combinations which include the Contribution. No hardware per se is
licensed hereunder. </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
Recipient understands that although each Contributor grants the licenses to its
Contributions set forth herein, no assurances are provided by any Contributor
that the Program does not infringe the patent or other intellectual property
rights of any other entity. Each Contributor disclaims any liability to Recipient
for claims brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the rights and
licenses granted hereunder, each Recipient hereby assumes sole responsibility
to secure any other intellectual property rights needed, if any. For example,
if a third party patent license is required to allow Recipient to distribute
the Program, it is Recipient's responsibility to acquire that license before
distributing the Program.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
Each Contributor represents that to its knowledge it has sufficient copyright
rights in its Contribution, if any, to grant the copyright license set forth in
this Agreement. </span></p>
<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
Program in object code form under its own license agreement, provided that:</span>
</p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it complies with the terms and conditions of this Agreement; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
its license agreement:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title
and non-infringement, and implied warranties or conditions of merchantability
and fitness for a particular purpose; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
effectively excludes on behalf of all Contributors all liability for damages,
including direct, indirect, special, incidental and consequential damages, such
as lost profits; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
states that any provisions which differ from this Agreement are offered by that
Contributor alone and not by any other party; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
states that source code for the Program is available from such Contributor, and
informs licensees how to obtain it in a reasonable manner on or through a
medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
<p><span style='font-size:10.0pt'>When the Program is made available in source
code form:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it must be made available under this Agreement; and </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
copy of this Agreement must be included with each copy of the Program. </span></p>
<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
copyright notices contained within the Program. </span></p>
<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
originator of its Contribution, if any, in a manner that reasonably allows
subsequent Recipients to identify the originator of the Contribution. </span></p>
<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
<p><span style='font-size:10.0pt'>Commercial distributors of software may
accept certain responsibilities with respect to end users, business partners
and the like. While this license is intended to facilitate the commercial use
of the Program, the Contributor who includes the Program in a commercial
product offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes the
Program in a commercial product offering, such Contributor (&quot;Commercial
Contributor&quot;) hereby agrees to defend and indemnify every other
Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
legal actions brought by a third party against the Indemnified Contributor to
the extent caused by the acts or omissions of such Commercial Contributor in
connection with its distribution of the Program in a commercial product
offering. The obligations in this section do not apply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In order
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial Contributor
to control, and cooperate with the Commercial Contributor in, the defense and
any related settlement negotiations. The Indemnified Contributor may participate
in any such claim at its own expense.</span> </p>
<p><span style='font-size:10.0pt'>For example, a Contributor might include the
Program in a commercial product offering, Product X. That Contributor is then a
Commercial Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance claims and
warranties are such Commercial Contributor's responsibility alone. Under this
section, the Commercial Contributor would have to defend claims against the
other Contributors related to those performance claims and warranties, and if a
court requires any other Contributor to pay any damages as a result, the
Commercial Contributor must pay those damages.</span> </p>
<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and distributing the
Program and assumes all risks associated with its exercise of rights under this
Agreement , including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs or
equipment, and unavailability or interruption of operations. </span></p>
<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
or unenforceable under applicable law, it shall not affect the validity or
enforceability of the remainder of the terms of this Agreement, and without
further action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.</span> </p>
<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
against any entity (including a cross-claim or counterclaim in a lawsuit)
alleging that the Program itself (excluding combinations of the Program with
other software or hardware) infringes such Recipient's patent(s), then such
Recipient's rights granted under Section 2(b) shall terminate as of the date
such litigation is filed. </span></p>
<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
shall terminate if it fails to comply with any of the material terms or
conditions of this Agreement and does not cure such failure in a reasonable
period of time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use and
distribution of the Program as soon as reasonably practicable. However,
Recipient's obligations under this Agreement and any licenses granted by
Recipient relating to the Program shall continue and survive. </span></p>
<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
copies of this Agreement, but in order to avoid inconsistency the Agreement is
copyrighted and may only be modified in the following manner. The Agreement
Steward reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement Steward has
the right to modify this Agreement. The Eclipse Foundation is the initial
Agreement Steward. The Eclipse Foundation may assign the responsibility to
serve as the Agreement Steward to a suitable separate entity. Each new version
of the Agreement will be given a distinguishing version number. The Program
(including Contributions) may always be distributed subject to the version of
the Agreement under which it was received. In addition, after a new version of
the Agreement is published, Contributor may elect to distribute the Program
(including its Contributions) under the new version. Except as expressly stated
in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
the intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not
expressly granted under this Agreement are reserved.</span> </p>
<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
State of New York and the intellectual property laws of the United States of
America. No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose. Each party waives
its rights to a jury trial in any resulting litigation.</span> </p>
<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
</div>
</body>
</html>

View file

@ -0,0 +1,168 @@
###############################################################################
# Copyright (c) 2012 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - initial API and implementation
# Marc-Andre Laperle
###############################################################################
# feature.properties
# contains externalized strings for feature.xml
# "%foo" in feature.xml corresponds to the key "foo" in this file
# java.io.Properties file (ISO 8859-1 with "\" escapes)
# This file should be translated.
# "featureName" property - name of the feature
featureName=C/C++ Unit Testing Support Source
# "providerName" property - name of the company that provides the feature
providerName=Eclipse CDT
# "updateSiteName" property - label for the update site
updateSiteName=Eclipse CDT Update Site
# "description" property - description of the feature
description=Support for running unit tests. Source code.
# copyright
copyright=\
Copyright (c) 2012 Anton Gorenkov and others.\n\
All rights reserved. This program and the accompanying materials\n\
are made available under the terms of the Eclipse Public License v1.0\n\
which accompanies this distribution, and is available at\n\
http://www.eclipse.org/legal/epl-v10.html
# "licenseURL" property - URL of the "Feature License"
# do not translate value - just change to point to a locale-specific HTML page
licenseURL=license.html
# "license" property - text of the "Feature Update License"
# should be plain text version of license agreement pointed to be "licenseURL"
license=\
Eclipse Foundation Software User Agreement\n\
February 1, 2011\n\
\n\
Usage Of Content\n\
\n\
THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
\n\
Applicable Licenses\n\
\n\
Unless otherwise indicated, all Content made available by the\n\
Eclipse Foundation is provided to you under the terms and conditions of\n\
the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
For purposes of the EPL, "Program" will mean the Content.\n\
\n\
Content includes, but is not limited to, source code, object code,\n\
documentation and other files maintained in the Eclipse Foundation source code\n\
repository ("Repository") in software modules ("Modules") and made available\n\
as downloadable archives ("Downloads").\n\
\n\
- Content may be structured and packaged into modules to facilitate delivering,\n\
extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
plug-in fragments ("Fragments"), and features ("Features").\n\
- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
in a directory named "plugins".\n\
- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
Each Feature may be packaged as a sub-directory in a directory named "features".\n\
Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
- Features may also include other Features ("Included Features"). Within a Feature, files\n\
named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
\n\
The terms and conditions governing Plug-ins and Fragments should be\n\
contained in files named "about.html" ("Abouts"). The terms and\n\
conditions governing Features and Included Features should be contained\n\
in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
Licenses may be located in any directory of a Download or Module\n\
including, but not limited to the following locations:\n\
\n\
- The top-level (root) directory\n\
- Plug-in and Fragment directories\n\
- Inside Plug-ins and Fragments packaged as JARs\n\
- Sub-directories of the directory named "src" of certain Plug-ins\n\
- Feature directories\n\
\n\
Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
Update License") during the installation process. If the Feature contains\n\
Included Features, the Feature Update License should either provide you\n\
with the terms and conditions governing the Included Features or inform\n\
you where you can locate them. Feature Update Licenses may be found in\n\
the "license" property of files named "feature.properties" found within a Feature.\n\
Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
terms and conditions (or references to such terms and conditions) that\n\
govern your use of the associated Content in that directory.\n\
\n\
THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
\n\
- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\
- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
- Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
\n\
IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
govern that particular Content.\n\
\n\
\n\Use of Provisioning Technology\n\
\n\
The Eclipse Foundation makes available provisioning software, examples of which include,\n\
but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
the purpose of allowing users to install software, documentation, information and/or\n\
other materials (collectively "Installable Software"). This capability is provided with\n\
the intent of allowing such users to install, extend and update Eclipse-based products.\n\
Information about packaging Installable Software is available at\n\
http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
\n\
You may use Provisioning Technology to allow other parties to install Installable Software.\n\
You shall be responsible for enabling the applicable license agreements relating to the\n\
Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
making it available in accordance with the Specification, you further acknowledge your\n\
agreement to, and the acquisition of all necessary rights to permit the following:\n\
\n\
1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
extending or updating the functionality of an Eclipse-based product.\n\
2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
govern the use of the Installable Software ("Installable Software Agreement") and such\n\
Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
with the Specification. Such Installable Software Agreement must inform the user of the\n\
terms and conditions that govern the Installable Software and must solicit acceptance by\n\
the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
indication of agreement by the user, the provisioning Technology will complete installation\n\
of the Installable Software.\n\
\n\
Cryptography\n\
\n\
Content may contain encryption software. The country in which you are\n\
currently may have restrictions on the import, possession, and use,\n\
and/or re-export to another country, of encryption software. BEFORE\n\
using any encryption software, please check the country's laws,\n\
regulations and policies concerning the import, possession, or use, and\n\
re-export of encryption software, to see if this is permitted.\n\
\n\
Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
########### end of license property ##########################################

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.eclipse.cdt.testsrunner.source.feature"
label="%featureName"
version="7.0.0.qualifier"
provider-name="%providerName">
<description>
%description
</description>
<copyright>
%copyright
</copyright>
<license url="%licenseURL">
%license
</license>
<url>
<update label="%updateSiteName" url="http://download.eclipse.org/tools/cdt/releases/indigo"/>
</url>
<plugin
id="org.eclipse.cdt.testsrunner.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.testsrunner.boost.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.testsrunner.gtest.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.cdt.testsrunner.qttest.source"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Eclipse Foundation Software User Agreement</title>
</head>
<body lang="EN-US">
<h2>Eclipse Foundation Software User Agreement</h2>
<p>February 1, 2011</p>
<h3>Usage Of Content</h3>
<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
(COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
<h3>Applicable Licenses</h3>
<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
(&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
<ul>
<li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
<li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
<li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
and/or Fragments associated with that Feature.</li>
<li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
</ul>
<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
including, but not limited to the following locations:</p>
<ul>
<li>The top-level (root) directory</li>
<li>Plug-in and Fragment directories</li>
<li>Inside Plug-ins and Fragments packaged as JARs</li>
<li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
<li>Feature directories</li>
</ul>
<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
that directory.</p>
<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
<ul>
<li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
<li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
<li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
<li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
<li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
<li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
</ul>
<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
<h3>Use of Provisioning Technology</h3>
<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
(&quot;Specification&quot;).</p>
<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
<ol>
<li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
product.</li>
<li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
accessed and copied to the Target Machine.</li>
<li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
</ol>
<h3>Cryptography</h3>
<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
possession, or use, and re-export of encryption software, to see if this is permitted.</p>
<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
</body>
</html>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.eclipse.cdt.features</groupId>
<version>7.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.testsrunner.source.feature</artifactId>
<packaging>eclipse-feature</packaging>
</project>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner.test</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,82 @@
#Mon Apr 16 13:01:24 EEST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.testsrunner.test
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.testsrunner.test.TestsRunnerTestActivator
Require-Bundle: org.junit,
org.eclipse.core.runtime,
org.eclipse.cdt.core.tests,
org.eclipse.cdt.testsrunner;bundle-version="7.0.0",
org.eclipse.cdt.testsrunner.boost;bundle-version="7.0.0",
org.eclipse.cdt.testsrunner.qttest;bundle-version="7.0.0",
org.eclipse.cdt.testsrunner.gtest;bundle-version="7.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor

View file

@ -0,0 +1,13 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
#Properties file for org.eclipse.cdt.testsrunner.test
Bundle-Name = C/C++ Development Tools Tests Running Support Tests
Bundle-Vendor = Eclipse CDT

View file

@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 22, 2007</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html>

View file

@ -0,0 +1,20 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
src/,\
OSGI-INF/,\
test.xml,\
about.html
jre.compilation.profile = J2SE-1.5
src.includes = about.html

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<version>1.0.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.testsrunner.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
<repositories>
<repository>
<id>cdt.repo</id>
<url>file:/${basedir}/../../releng/org.eclipse.cdt.repo/target/repository</url>
<layout>p2</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<useUIHarness>true</useUIHarness>
<includes>
<include>**/TestsRunnerSuite.*</include>
</includes>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,123 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.core;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
import org.eclipse.cdt.testsrunner.internal.model.TestModelManager;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestSuite;
/**
* Base test case for test suites & test cases reordering in TestModelManager.
*/
@SuppressWarnings("nls")
public abstract class TestModelManagerBaseReorderingTestCase extends TestCase {
protected TestModelManager modelManager;
protected List<String> expectedSuitesOrder = new ArrayList<String>();
protected abstract ITestSuite createTestsHierarchy();
protected abstract void visitTestItem(String name);
@Override
protected void setUp() throws Exception {
super.setUp();
modelManager = new TestModelManager(createTestsHierarchy(), false);
modelManager.testingStarted();
}
@Override
protected void tearDown() throws Exception {
modelManager.testingFinished();
ITestItem[] rootTestSuiteChildren = modelManager.getRootSuite().getChildren();
assertEquals("Unexpected children count", expectedSuitesOrder.size(), rootTestSuiteChildren.length);
for (int i = 0; i < rootTestSuiteChildren.length; i++) {
assertEquals("Unexpected child name", expectedSuitesOrder.get(i), rootTestSuiteChildren[i].getName());
}
}
private void visitTestItemWithExpectation(String name) {
visitTestItem(name);
expectedSuitesOrder.add(name);
}
public void testNoReordering() {
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("item2");
visitTestItemWithExpectation("item3");
}
public void testItemAdd() {
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("itemNew");
visitTestItemWithExpectation("item2");
visitTestItemWithExpectation("item3");
}
public void testItemAddToBeginAndEnd() {
visitTestItemWithExpectation("itemNew");
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("item2");
visitTestItemWithExpectation("item3");
visitTestItemWithExpectation("itemNew2");
}
public void testItemRemove() {
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("item3");
}
public void testItemRemoveFromBeginAndEnd() {
visitTestItemWithExpectation("item2");
}
public void testItemRemoveAndAdd() {
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("itemNew");
visitTestItemWithExpectation("item3");
}
public void testItemOrderChange() {
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("item3");
visitTestItemWithExpectation("item2");
}
public void testItemReverse() {
visitTestItemWithExpectation("item3");
visitTestItemWithExpectation("item2");
visitTestItemWithExpectation("item1");
}
public void testItemVisitTwice() {
visitTestItem("item1");
visitTestItemWithExpectation("item2");
visitTestItemWithExpectation("item1");
visitTestItem("item3");
visitTestItemWithExpectation("item3");
}
public void testItemVisitTwiceAndReorder() {
visitTestItem("item3");
visitTestItemWithExpectation("item1");
visitTestItemWithExpectation("item3");
visitTestItemWithExpectation("item2");
}
}

View file

@ -0,0 +1,40 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.core;
import org.eclipse.cdt.testsrunner.internal.model.TestCase;
import org.eclipse.cdt.testsrunner.internal.model.TestModelManager;
import org.eclipse.cdt.testsrunner.internal.model.TestSuite;
import org.eclipse.cdt.testsrunner.model.ITestSuite;
/**
* Tests on the test cases reordering in TestModelManager.
*/
@SuppressWarnings("nls")
public class TestModelManagerCasesReorderingTestCase extends TestModelManagerBaseReorderingTestCase {
@Override
protected ITestSuite createTestsHierarchy() {
TestSuite rootTestSuite = new TestSuite(TestModelManager.ROOT_TEST_SUITE_NAME, null);
rootTestSuite.getChildrenList().add(new TestCase("item1", rootTestSuite));
rootTestSuite.getChildrenList().add(new TestCase("item2", rootTestSuite));
rootTestSuite.getChildrenList().add(new TestCase("item3", rootTestSuite));
return rootTestSuite;
}
@Override
protected void visitTestItem(String name) {
modelManager.enterTestCase(name);
modelManager.exitTestCase();
}
}

View file

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.core;
import org.eclipse.cdt.testsrunner.internal.model.TestModelManager;
import org.eclipse.cdt.testsrunner.internal.model.TestSuite;
import org.eclipse.cdt.testsrunner.model.ITestSuite;
/**
* Tests on the test suites reordering in TestModelManager.
*/
@SuppressWarnings("nls")
public class TestModelManagerSuitesReorderingTestCase extends TestModelManagerBaseReorderingTestCase {
@Override
protected ITestSuite createTestsHierarchy() {
TestSuite rootTestSuite = new TestSuite(TestModelManager.ROOT_TEST_SUITE_NAME, null);
rootTestSuite.getChildrenList().add(new TestSuite("item1", rootTestSuite));
rootTestSuite.getChildrenList().add(new TestSuite("item2", rootTestSuite));
rootTestSuite.getChildrenList().add(new TestSuite("item3", rootTestSuite));
return rootTestSuite;
}
@Override
protected void visitTestItem(String name) {
modelManager.enterTestSuite(name);
modelManager.exitTestSuite();
}
}

View file

@ -0,0 +1,55 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.test;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.eclipse.cdt.testsrunner.core.TestModelManagerCasesReorderingTestCase;
import org.eclipse.cdt.testsrunner.core.TestModelManagerSuitesReorderingTestCase;
import org.eclipse.cdt.testsrunner.testsrunners.BoostTestCase;
import org.eclipse.cdt.testsrunner.testsrunners.GoogleTestCase;
import org.eclipse.cdt.testsrunner.testsrunners.QtTestCase;
/**
* Test suite with all the tests on Tests Runner.
*/
public class TestsRunnerSuite extends TestSuite {
public TestsRunnerSuite() {
}
public TestsRunnerSuite(Class<? extends TestCase> theClass, String name) {
super(theClass, name);
}
public TestsRunnerSuite(Class<? extends TestCase> theClass) {
super(theClass);
}
public TestsRunnerSuite(String name) {
super(name);
}
public static Test suite() {
final TestsRunnerSuite suite = new TestsRunnerSuite();
// Core
suite.addTestSuite(TestModelManagerSuitesReorderingTestCase.class);
suite.addTestSuite(TestModelManagerCasesReorderingTestCase.class);
// Tests Runners Plug-ins
suite.addTestSuite(BoostTestCase.class);
suite.addTestSuite(GoogleTestCase.class);
suite.addTestSuite(QtTestCase.class);
return suite;
}
}

View file

@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.test;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class TestsRunnerTestActivator extends Plugin {
/** The plug-in ID .*/
public static final String PLUGIN_ID = "org.eclipse.cdt.testsrunner.test"; //$NON-NLS-1$
/** Plug-in instance. */
private static TestsRunnerTestActivator plugin;
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared plug-in instance.
*
* @return the plug-in instance
*/
public static TestsRunnerTestActivator getDefault() {
return plugin;
}
}

View file

@ -0,0 +1,99 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.testsrunners;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import junit.framework.TestCase;
import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.TestingException;
import org.eclipse.cdt.testsrunner.test.TestsRunnerTestActivator;
import org.eclipse.core.runtime.Plugin;
/**
* Base test case for Tests Runner provider plug-ins testing.
*/
@SuppressWarnings("nls")
public abstract class BaseTestCase extends TestCase {
protected static final String EOL = System.getProperty("line.separator");
protected MockTestModelUpdater mockModelUpdater = new MockTestModelUpdater();
protected ITestsRunnerProvider testsRunner = createTestsRunner();
protected boolean expectTestingException = false;
protected abstract ITestsRunnerProvider createTestsRunner();
protected String getAboveComment() {
return getContents(1)[0].toString();
}
private StringBuilder[] getContents(int sections) {
try {
return TestSourceReader.getContentsForTest(getPlugin().getBundle(), getSourcePrefix(), getClass(), getName(), sections);
} catch (IOException e) {
fail(e.getMessage());
return null;
}
}
protected Plugin getPlugin() {
return TestsRunnerTestActivator.getDefault();
}
protected String getSourcePrefix() {
return "src";
}
protected void runTestsRunner() throws TestingException {
try {
mockModelUpdater.replay();
String inputString = getAboveComment();
InputStream inStream = new ByteArrayInputStream(inputString.getBytes("UTF-8"));
boolean testingExceptionHappen = false;
String exceptionMessage = null;
try {
testsRunner.run(mockModelUpdater, inStream);
} catch (TestingException e) {
testingExceptionHappen = true;
exceptionMessage = e.getMessage();
}
if (expectTestingException != testingExceptionHappen) {
if (testingExceptionHappen) {
fail("Unexpected exception: "+exceptionMessage);
} else {
fail("TestingException is expected, but did not happen!");
}
}
} catch (UnsupportedEncodingException e) {
fail(e.getMessage());
}
}
protected void expectTestingException() {
expectTestingException = true;
}
@Override
protected void tearDown() throws Exception {
runTestsRunner();
}
}

View file

@ -0,0 +1,481 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.testsrunners;
import org.eclipse.cdt.testsrunner.internal.boost.BoostTestsRunnerProvider;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
/**
* Tests for {@see BoostTestsRunner} class
*/
@SuppressWarnings("nls")
public class BoostTestCase extends BaseTestCase {
private static final String DEFAULT_LOCATION_FILE = null;
private static final int DEFAULT_LOCATION_LINE = -1;
private static final String EXCEPTION_CHECKPOINT_SUFFIX = "\nLast check point was here.";
@Override
public ITestsRunnerProvider createTestsRunner() {
return new BoostTestsRunnerProvider();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test"/>
// </TestSuite>
//</TestLog>
public void testTheOnlyTestCase() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test1"/>
// <TestCase name="test2"/>
// <TestCase name="test3"/>
// </TestSuite>
//</TestLog>
public void testAFewTestCases() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test1");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test2");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test3");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestSuite name="InnerTS"/>
// </TestSuite>
//</TestLog>
public void testEmptyTestSuite() {
// NOTE: This is impossible input data (at least, for current version of Boost), but we check it anyway
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestSuite("InnerTS");
mockModelUpdater.exitTestSuite();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestSuite name="InnerTS">
// <TestCase name="test1"/>
// <TestCase name="test2"/>
// <TestCase name="test3"/>
// </TestSuite>
// </TestSuite>
//</TestLog>
public void testAFewTestCasesInTestSuite() {
// NOTE: This is impossible input data (at least, for current version of Boost), but we check it anyway
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestSuite("InnerTS");
mockModelUpdater.enterTestCase("test1");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test2");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test3");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestSuite name="InnerTS">
// <TestSuite name="InnerInnerTS"/>
// </TestSuite>
// </TestSuite>
//</TestLog>
public void testEmptyTestSuiteInTestSuite() {
// NOTE: This is impossible input data (at least, for current version of Boost), but we check it anyway
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestSuite("InnerTS");
mockModelUpdater.enterTestSuite("InnerInnerTS");
mockModelUpdater.exitTestSuite();
mockModelUpdater.exitTestSuite();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestSuite name="InnerTS">
// <TestSuite name="InnerInnerTS">
// <TestCase name="test1"/>
// </TestSuite>
// <TestCase name="test2"/>
// <TestCase name="test3"/>
// </TestSuite>
// </TestSuite>
// <TestCase name="test4">
// </TestCase>
//</TestLog>
public void testSimpleTestsHierarchy() {
// NOTE: This is impossible input data (at least, for current version of Boost), but we check it anyway
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestSuite("InnerTS");
mockModelUpdater.enterTestSuite("InnerInnerTS");
mockModelUpdater.enterTestCase("test1");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestCase("test2");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test3");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestCase("test4");
mockModelUpdater.exitTestCase();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="testPass">
// <Info file="file.cpp" line="22">check 1 passed</Info>
// </TestCase>
// <TestCase name="testPassWithWarning">
// <Warning file="file.cpp" line="27">condition 0 is not satisfied</Warning>
// <Message file="file2.h" line="220">Test case testPassWithWarning did not run any assertions</Message>
// </TestCase>
// <TestCase name="testPassIfEmpty">
// <Message file="file2.h" line="220">Test case testPassIfEmpty did not run any assertions</Message>
// </TestCase>
// <TestCase name="testFailWithCheck">
// <Error file="file.cpp" line="32">check 0 failed</Error>
// <Info file="file.cpp" line="33">check 1 passed</Info>
// </TestCase>
// <TestCase name="testFailWithRequire">
// <FatalError file="file.cpp" line="38">critical check 0 failed</FatalError>
// </TestCase>
// <TestCase name="testAbortedOnException">
// <Exception>unknown type</Exception>
// </TestCase>
// <TestCase name="testAbortedOnNullDereference">
// <Exception>memory access violation at address: 0x00000000: no mapping at fault address</Exception>
// <Message file="file2.h" line="164">Test is aborted</Message>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testDifferentTestStatuses() {
mockModelUpdater.skipCalls("addTestMessage");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("testPass");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testPassWithWarning");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testPassIfEmpty");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testFailWithCheck");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testFailWithRequire");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testAbortedOnException");
mockModelUpdater.setTestStatus(ITestItem.Status.Aborted);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testAbortedOnNullDereference");
mockModelUpdater.setTestStatus(ITestItem.Status.Aborted);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test">
// <Info file="file.cpp" line="22"/>
// <Exception><LastCheckpoint file="file2.cpp" line="47"/></Exception>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testEmptyMessage() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test");
mockModelUpdater.addTestMessage("file.cpp", 22, ITestMessage.Level.Info, "");
mockModelUpdater.addTestMessage("file2.cpp", 47, ITestMessage.Level.Exception, EXCEPTION_CHECKPOINT_SUFFIX);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test">
// <Warning file="file" line="42"> Custom warning </Warning>
// <Exception> Exception message <LastCheckpoint file="file2" line="47"/> end </Exception>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testSpacesInBeginAndEndOfMessage() {
// NOTE: Last checkpoint tag cannot be in the middle of exception (at least, for current version of Boost), but we check it anyway
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test");
mockModelUpdater.addTestMessage("file", 42, ITestMessage.Level.Warning, " Custom warning ");
mockModelUpdater.addTestMessage("file2", 47, ITestMessage.Level.Exception, " Exception message end "+EXCEPTION_CHECKPOINT_SUFFIX);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test">
// <Warning>Custom warning</Warning>
// <Exception file="file.cpp" line="1">Exceptions should be located by pass point</Exception>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testMessageWithoutLocation() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Warning, "Custom warning");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Exception, "Exceptions should be located by pass point");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test">
// <Warning file="file.cpp">No line number</Warning>
// <Warning file="" line="1">Empty file name</Warning>
// <Warning line="2">No file name</Warning>
// <Exception>Exception without line number<LastCheckpoint file="file2.cpp"/></Exception>
// <Exception>Exception with empty file name<LastCheckpoint file="" line="3"/></Exception>
// <Exception>Exception without file name<LastCheckpoint line="4"/></Exception>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testMessageWithLocation() {
// NOTE: This is impossible input data (at least, for current version of Boost), but we check it anyway
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test");
mockModelUpdater.addTestMessage("file.cpp", DEFAULT_LOCATION_LINE, ITestMessage.Level.Warning, "No line number");
mockModelUpdater.addTestMessage("", 1, ITestMessage.Level.Warning, "Empty file name");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, 2, ITestMessage.Level.Warning, "No file name");
// NOTE: Last check point is not available, so EXCEPTION_CHECKPOINT_SUFFIX should not be added
mockModelUpdater.addTestMessage("file2.cpp", DEFAULT_LOCATION_LINE, ITestMessage.Level.Exception, "Exception without line number");
mockModelUpdater.addTestMessage("", 3, ITestMessage.Level.Exception, "Exception with empty file name");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, 4, ITestMessage.Level.Exception, "Exception without file name");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="test1">
// <Error file="file1.cpp" line="1">Message with location</Error>
// <Error>Message without location</Error>
// </TestCase>
// <TestCase name="test2">
// <Exception>Exception with location<LastCheckpoint file="file2.cpp" line="2"/></Exception>
// <Exception>Exception without location<LastCheckpoint/></Exception>
// </TestCase>
// <TestCase name="test3">
// <Error file="file3.cpp" line="3">Another message with location</Error>
// <Exception>Another exception without location</Exception>
// </TestCase>
// <TestCase name="test4">
// <Exception>Another exception with location<LastCheckpoint file="file4.cpp" line="4"/></Exception>
// <Error>Another message without location</Error>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testMessagesWithAndWithoutLocation() {
// NOTE: This is impossible input data (at least, for current version of Boost), but we check it anyway
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("test1");
mockModelUpdater.addTestMessage("file1.cpp", 1, ITestMessage.Level.Error, "Message with location");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Error, "Message without location");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test2");
mockModelUpdater.addTestMessage("file2.cpp", 2, ITestMessage.Level.Exception, "Exception with location"+EXCEPTION_CHECKPOINT_SUFFIX);
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Exception, "Exception without location");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test3");
mockModelUpdater.addTestMessage("file3.cpp", 3, ITestMessage.Level.Error, "Another message with location");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Exception, "Another exception without location");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("test4");
mockModelUpdater.addTestMessage("file4.cpp", 4, ITestMessage.Level.Exception, "Another exception with location"+EXCEPTION_CHECKPOINT_SUFFIX);
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Error, "Another message without location");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="testPass">
// <Info file="file.cpp" line="22">check 1 passed</Info>
// <TestingTime>1000</TestingTime>
// </TestCase>
// <TestCase name="testFail">
// <FatalError file="file2.cpp" line="38">critical check 0 failed</FatalError>
// <TestingTime>2000</TestingTime>
// </TestCase>
// <TestCase name="testAbortedOnException">
// <Exception>exception message</Exception>
// <TestingTime>3000</TestingTime>
// </TestCase>
// <TestCase name="testAbortedOnNullDereference">
// <Exception>another exception message</Exception>
// <Message file="file3.h" line="164">Test is aborted</Message>
// <TestingTime>4000</TestingTime>
// </TestCase>
// <TestCase name="testAbortedOnExceptionWithLocation">
// <Exception>yet another exception message<LastCheckpoint file="file4.cpp" line="47"/></Exception>
// <TestingTime>5000</TestingTime>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testExecutionTimePresence() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("testPass");
mockModelUpdater.addTestMessage("file.cpp", 22, ITestMessage.Level.Info, "check 1 passed");
mockModelUpdater.setTestingTime(1);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testFail");
mockModelUpdater.addTestMessage("file2.cpp", 38, ITestMessage.Level.FatalError, "critical check 0 failed");
mockModelUpdater.setTestingTime(2);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testAbortedOnException");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Exception, "exception message");
mockModelUpdater.setTestingTime(3);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testAbortedOnNullDereference");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Exception, "another exception message");
mockModelUpdater.addTestMessage("file3.h", 164, ITestMessage.Level.Message, "Test is aborted");
mockModelUpdater.setTestingTime(4);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testAbortedOnExceptionWithLocation");
mockModelUpdater.addTestMessage("file4.cpp", 47, ITestMessage.Level.Exception, "yet another exception message"+EXCEPTION_CHECKPOINT_SUFFIX);
mockModelUpdater.setTestingTime(5);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//
public void testNoInput() {
// NOTE: The comment above is left blank intentionally
expectTestingException();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="testPass">
// <!-- TestCase is not closed -->
// </TestSuite>
//</TestLog>
public void testBadFormedXml() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="testPass">
public void testUnexceptedXmlEnd() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<TestLog>
// <TestSuite name="MainTS">
// <UnexpectedXmlElement name="testPass">
// <Info file="file.cpp" line="22">check 1 passed</Info>
// <TestingTime>100</TestingTime>
// </UnexpectedXmlElement>
// </TestSuite>
//</TestLog>
public void testUnexpectedXmlElement() {
mockModelUpdater.skipCalls("enterTestSuite");
expectTestingException();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="testPass">
// <Info file="file.cpp" line="wrong_value">check 1 passed</Info>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testWrongLineNumberValue() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<TestLog>
// <TestSuite name="MainTS">
// <TestCase name="testPass">
// <TestingTime>wrong value</TestingTime>
// </TestCase>
// </TestSuite>
//</TestLog>
public void testWrongExecutionTimeValue() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
}

View file

@ -0,0 +1,698 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.testsrunners;
import org.eclipse.cdt.testsrunner.internal.gtest.GoogleTestsRunnerProvider;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
/**
* Tests for {@see GoogleTestsRunner} class
*/
@SuppressWarnings("nls")
public class GoogleTestCase extends BaseTestCase {
private static final String DEFAULT_LOCATION_FILE = null;
private static final int DEFAULT_LOCATION_LINE = 1;
@Override
protected ITestsRunnerProvider createTestsRunner() {
return new GoogleTestsRunnerProvider();
}
//Running main() from gtest_main.cc
//[==========] Running 0 tests from 0 test cases.
//[==========] 0 tests from 0 test cases ran. (0 ms total)
//[ PASSED ] 0 tests.
public void testNoTestCases() {
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest
//[ OK ] DemoTestCase.DemoTest (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testTheOnlyTestCase() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.enterTestSuite("DemoTestCase");
mockModelUpdater.enterTestCase("DemoTest");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//[==========] Running 3 tests from 1 test case.
//[----------] Global test environment set-up.
//[----------] 3 tests from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest1
//[ OK ] DemoTestCase.DemoTest1 (0 ms)
//[ RUN ] DemoTestCase.DemoTest2
//[ OK ] DemoTestCase.DemoTest2 (0 ms)
//[ RUN ] DemoTestCase.DemoTest3
//[ OK ] DemoTestCase.DemoTest3 (0 ms)
//[----------] 3 tests from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 3 tests from 1 test case ran. (0 ms total)
//[ PASSED ] 3 tests.
public void testAFewTestCasesInTheOnlyTestSuites() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.enterTestSuite("DemoTestCase");
mockModelUpdater.enterTestCase("DemoTest1");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("DemoTest2");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("DemoTest3");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//[==========] Running 2 tests from 2 test cases.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest
//[ OK ] DemoTestCase.DemoTest (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//
//[----------] 1 test from DemoTestCase2
//[ RUN ] DemoTestCase2.DemoTest2
//[ OK ] DemoTestCase2.DemoTest2 (0 ms)
//[----------] 1 test from DemoTestCase2 (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 2 tests from 2 test cases ran. (0 ms total)
//[ PASSED ] 2 tests.
public void testTheOnlyTestCasesInAFewTestSuites() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.enterTestSuite("DemoTestCase");
mockModelUpdater.enterTestCase("DemoTest");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestSuite("DemoTestCase2");
mockModelUpdater.enterTestCase("DemoTest2");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//[==========] Running 4 tests from 2 test cases.
//[----------] Global test environment set-up.
//[----------] 2 tests from DemoTestCase1
//[ RUN ] DemoTestCase1.DemoTest1
//[ OK ] DemoTestCase1.DemoTest1 (0 ms)
//[ RUN ] DemoTestCase1.DemoTest2
//[ OK ] DemoTestCase1.DemoTest2 (0 ms)
//[----------] 2 tests from DemoTestCase1 (0 ms total)
//
//[----------] 2 tests from DemoTestCase2
//[ RUN ] DemoTestCase2.DemoTest1
//[ OK ] DemoTestCase2.DemoTest1 (0 ms)
//[ RUN ] DemoTestCase2.DemoTest2
//[ OK ] DemoTestCase2.DemoTest2 (0 ms)
//[----------] 2 tests from DemoTestCase2 (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 4 tests from 2 test cases ran. (0 ms total)
//[ PASSED ] 4 tests.
public void testAFewTestCasesWithTheSameNameInDifferentTestSuites() {
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.enterTestSuite("DemoTestCase1");
mockModelUpdater.enterTestCase("DemoTest1");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("DemoTest2");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestSuite("DemoTestCase2");
mockModelUpdater.enterTestCase("DemoTest1");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("DemoTest2");
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//[==========] Running 4 tests from 1 test case.
//[----------] Global test environment set-up.
//[----------] 4 tests from DemoTestCase
//[ RUN ] DemoTestCase.TestPass
//[ OK ] DemoTestCase.TestPass (0 ms)
//[ RUN ] DemoTestCase.TestFail
//demo_file.cc:38: Failure
//Value of: 2
//Expected: 1
//[ FAILED ] DemoTestCase.TestFail (0 ms)
//[ RUN ] DemoTestCase.TestAFewFails
//demo_file.cc:42: Failure
//Value of: 2
//Expected: 1
//demo_file.cc:43: Failure
//Value of: 2
//Expected: 1
//[ FAILED ] DemoTestCase.TestAFewFails (0 ms)
//[ RUN ] DemoTestCase.TestCustomFails
//demo_file.cc:47: Failure
//Failed
//Custom fatal fail!
//demo_file.cc:48: Failure
//Failed
//Another custom fatal fail!
//demo_file.cc:49: Failure
//Failed
//Yet another custom fatal fail!
//[ FAILED ] DemoTestCase.TestCustomFails (0 ms)
//[----------] 4 tests from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 4 tests from 1 test case ran. (1 ms total)
//[ PASSED ] 1 test.
//[ FAILED ] 3 tests, listed below:
//[ FAILED ] DemoTestCase.TestFail
//[ FAILED ] DemoTestCase.TestAFewFails
//[ FAILED ] DemoTestCase.TestCustomFails
//
// 3 FAILED TESTS
public void testDifferentTestStatuses() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("exitTestSuite");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.enterTestCase("TestPass");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("TestFail");
mockModelUpdater.addTestMessage("demo_file.cc", 38, ITestMessage.Level.Error, "Value of: 2"+EOL+"Expected: 1");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("TestAFewFails");
mockModelUpdater.addTestMessage("demo_file.cc", 42, ITestMessage.Level.Error, "Value of: 2"+EOL+"Expected: 1");
mockModelUpdater.addTestMessage("demo_file.cc", 43, ITestMessage.Level.Error, "Value of: 2"+EOL+"Expected: 1");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("TestCustomFails");
mockModelUpdater.addTestMessage("demo_file.cc", 47, ITestMessage.Level.Error, "Failed"+EOL+"Custom fatal fail!");
mockModelUpdater.addTestMessage("demo_file.cc", 48, ITestMessage.Level.Error, "Failed"+EOL+"Another custom fatal fail!");
mockModelUpdater.addTestMessage("demo_file.cc", 49, ITestMessage.Level.Error, "Failed"+EOL+"Yet another custom fatal fail!");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
}
//Running main() from gtest_main.cc
//[==========] Running 2 tests from 1 test case.
//[----------] Global test environment set-up.
//[----------] 2 tests from DemoTestCase
//[ RUN ] DemoTestCase.TestWithSimpleTrace
//demo_file.cc:36: Failure
//Value of: 2
//Expected: 1
//Google Test trace:
//demo_file.cc:41: Trace point #2 in TestWithSimpleTrace
//demo_file.cc:40: Trace point #1 in TestWithSimpleTrace
//[ FAILED ] DemoTestCase.TestWithSimpleTrace (1 ms)
//[ RUN ] DemoTestCase.TestTraceForMultipleFails
//demo_file.cc:36: Failure
//Value of: 2
//Expected: 1
//Google Test trace:
//demo_file.cc:46: Trace point #1 in TestTraceForMultipleFails
//demo_file.cc:36: Failure
//Value of: 2
//Expected: 1
//Google Test trace:
//demo_file.cc:48: Trace point #2 in TestTraceForMultipleFails
//demo_file.cc:46: Trace point #1 in TestTraceForMultipleFails
//[ FAILED ] DemoTestCase.TestTraceForMultipleFails (0 ms)
//[----------] 2 tests from DemoTestCase (1 ms total)
//
//[----------] Global test environment tear-down
//[==========] 2 tests from 1 test case ran. (1 ms total)
//[ PASSED ] 0 tests.
//[ FAILED ] 2 tests, listed below:
//[ FAILED ] DemoTestCase.TestWithSimpleTrace
//[ FAILED ] DemoTestCase.TestTraceForMultipleFails
//
// 2 FAILED TESTS
public void testScopedTraceSupport() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("exitTestSuite");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestCase("TestWithSimpleTrace");
mockModelUpdater.addTestMessage("demo_file.cc", 36, ITestMessage.Level.Error, "Value of: 2"+EOL+"Expected: 1");
mockModelUpdater.addTestMessage("demo_file.cc", 41, ITestMessage.Level.Info, "Trace point #2 in TestWithSimpleTrace");
mockModelUpdater.addTestMessage("demo_file.cc", 40, ITestMessage.Level.Info, "Trace point #1 in TestWithSimpleTrace");
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("TestTraceForMultipleFails");
mockModelUpdater.addTestMessage("demo_file.cc", 36, ITestMessage.Level.Error, "Value of: 2"+EOL+"Expected: 1");
mockModelUpdater.addTestMessage("demo_file.cc", 46, ITestMessage.Level.Info, "Trace point #1 in TestTraceForMultipleFails");
mockModelUpdater.addTestMessage("demo_file.cc", 36, ITestMessage.Level.Error, "Value of: 2"+EOL+"Expected: 1");
mockModelUpdater.addTestMessage("demo_file.cc", 48, ITestMessage.Level.Info, "Trace point #2 in TestTraceForMultipleFails");
mockModelUpdater.addTestMessage("demo_file.cc", 46, ITestMessage.Level.Info, "Trace point #1 in TestTraceForMultipleFails");
mockModelUpdater.exitTestCase();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.TestMessageLocationFormats
//demo_file_name2.cpp:40: Failure
//Standard format with file name & line number
//unknown file:41: Failure
//Standard format with unknown file name
//demo_file_name2.cpp(42): Failure
//VS-like format with file name & line number
//unknown file(43): Failure
//VS-like format with unknown file name
//demo_file_name2.cpp: Failure
//Location with unknown line number
//unknown file: Failure
//Location with unknown file name & line number
//[ FAILED ] DemoTestCase.TestMessageLocationFormats (1 ms)
//[----------] 1 test from DemoTestCase (1 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (1 ms total)
//[ PASSED ] 0 tests.
//[ FAILED ] 1 test, listed below:
//[ FAILED ] DemoTestCase.TestMessageLocationFormats
//
// 1 FAILED TEST
public void testDifferentLocationsFormatsWithStandardMessageFormat() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("exitTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
mockModelUpdater.skipCalls("exitTestCase");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.addTestMessage("demo_file_name2.cpp", 40, ITestMessage.Level.Error, "Standard format with file name & line number");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, 41, ITestMessage.Level.Error, "Standard format with unknown file name");
mockModelUpdater.addTestMessage("demo_file_name2.cpp", 42, ITestMessage.Level.Error, "VS-like format with file name & line number");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, 43, ITestMessage.Level.Error, "VS-like format with unknown file name");
mockModelUpdater.addTestMessage("demo_file_name2.cpp", DEFAULT_LOCATION_LINE, ITestMessage.Level.Error, "Location with unknown line number");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Error, "Location with unknown file name & line number");
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.TestMessageLocationFormats
//demo_file_name2.cpp:40: error: Standard format with file name & line number
//unknown file:41: error: Standard format with unknown file name
//demo_file_name2.cpp(42): error: VS-like format with file name & line number
//unknown file(43): error: VS-like format with unknown file name
//demo_file_name2.cpp: error: Location with unknown line number
//unknown file: error: Location with unknown file name & line number
//[ FAILED ] DemoTestCase.TestMessageLocationFormats (1 ms)
//[----------] 1 test from DemoTestCase (1 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (1 ms total)
//[ PASSED ] 0 tests.
//[ FAILED ] 1 test, listed below:
//[ FAILED ] DemoTestCase.TestMessageLocationFormats
//
// 1 FAILED TEST
public void testDifferentLocationsFormatsWithVSLikeMessageFormat() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("exitTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
mockModelUpdater.skipCalls("exitTestCase");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.addTestMessage("demo_file_name2.cpp", 40, ITestMessage.Level.Error, "Standard format with file name & line number");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, 41, ITestMessage.Level.Error, "Standard format with unknown file name");
mockModelUpdater.addTestMessage("demo_file_name2.cpp", 42, ITestMessage.Level.Error, "VS-like format with file name & line number");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, 43, ITestMessage.Level.Error, "VS-like format with unknown file name");
mockModelUpdater.addTestMessage("demo_file_name2.cpp", DEFAULT_LOCATION_LINE, ITestMessage.Level.Error, "Location with unknown line number");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Error, "Location with unknown file name & line number");
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.TestMultiLineMessage
//demo_file.cc:40: Failure
//Line 1
//Line 2
//Line 3
//[ FAILED ] DemoTestCase.TestMultiLineMessage (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 0 tests.
//[ FAILED ] 1 test, listed below:
//[ FAILED ] DemoTestCase.TestMultiLineMessage
//
// 1 FAILED TEST
public void testMultiLineMessage() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("exitTestSuite");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.enterTestCase("TestMultiLineMessage");
mockModelUpdater.addTestMessage("demo_file.cc", 40, ITestMessage.Level.Error, "Line 1"+EOL+"Line 2"+EOL+"Line 3");
mockModelUpdater.exitTestCase();
}
//Running main() from gtest_main.cc
//[==========] Running 2 tests from 2 test cases.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase1
//[ RUN ] DemoTestCase1.Test1
//unknown file: Failure
//Unknown C++ exception thrown in the test body.
//[ FAILED ] DemoTestCase1.Test1 (1000 ms)
//[----------] 1 test from DemoTestCase1 (1000 ms total)
//
//[----------] 1 test from DemoTestCase2
//[ RUN ] DemoTestCase2.Test2
//[ OK ] DemoTestCase2.Test2 (2000 ms)
//[----------] 1 test from DemoTestCase2 (2000 ms total)
//
//[----------] Global test environment tear-down
//[==========] 2 tests from 2 test cases ran. (3000 ms total)
//[ PASSED ] 1 test.
//[ FAILED ] 1 test, listed below:
//[ FAILED ] DemoTestCase1.Test1
//
// 1 FAILED TEST
public void testTestingTimeSupport() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("exitTestSuite");
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.skipCalls("addTestMessage");
mockModelUpdater.enterTestCase("Test1");
mockModelUpdater.setTestingTime(1000);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("Test2");
mockModelUpdater.setTestingTime(2000);
mockModelUpdater.exitTestCase();
}
//Running main() from gtest_main.cc
//[==========] Running 3 tests from 1 test case.
//[----------] Global test environment set-up.
//[----------] 3 tests from Inst/DemoTestCase
//[ RUN ] Inst/DemoTestCase.Test/0
//demo_file.cc:50: Failure
//Failed
//Param1
//[ FAILED ] Inst/DemoTestCase.Test/0, where GetParam() = "Param1" (0 ms)
//[ RUN ] Inst/DemoTestCase.Test/1
//[ OK ] Inst/DemoTestCase.Test/1 (0 ms)
//[ RUN ] Inst/DemoTestCase.Test/2
//demo_file.cc:50: Failure
//Failed
//Param3
//[ FAILED ] Inst/DemoTestCase.Test/2, where GetParam() = "Param3" (0 ms)
//[----------] 3 tests from Inst/DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 3 tests from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
//[ FAILED ] 2 tests, listed below:
//[ FAILED ] Inst/DemoTestCase.Test/0, where GetParam() = "Param1"
//[ FAILED ] Inst/DemoTestCase.Test/2, where GetParam() = "Param3"
//
// 2 FAILED TESTS
public void testParametrizedTestsSupport() {
mockModelUpdater.enterTestSuite("Inst/DemoTestCase");
mockModelUpdater.enterTestCase("Test/0");
mockModelUpdater.addTestMessage("demo_file.cc", 50, ITestMessage.Level.Error, "Failed"+EOL+"Param1");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Info, "Instantiated with GetParam() = \"Param1\"");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("Test/1");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("Test/2");
mockModelUpdater.addTestMessage("demo_file.cc", 50, ITestMessage.Level.Error, "Failed"+EOL+"Param3");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Info, "Instantiated with GetParam() = \"Param3\"");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from Inst/DemoTestCase
//[ RUN ] Inst/DemoTestCase.Test/0
//demo_file.cc:50: Failure
//Failed
//[ FAILED ] Inst/DemoTestCase.Test/0, where GetParam() = 0x4f50cc (0 ms)
//[----------] 1 test from Inst/DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 0 tests.
//[ FAILED ] 1 test, listed below:
//[ FAILED ] Inst/DemoTestCase.Test/0, where GetParam() = 0x4f50cc
//
// 2 FAILED TESTS
public void testParametrizedTestsWithoutQuotesSupport() {
mockModelUpdater.enterTestSuite("Inst/DemoTestCase");
mockModelUpdater.enterTestCase("Test/0");
mockModelUpdater.addTestMessage("demo_file.cc", 50, ITestMessage.Level.Error, "Failed");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Info, "Instantiated with GetParam() = 0x4f50cc");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//[==========] Running 3 tests from 3 test cases.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase/0, where TypeParam = char
//[ RUN ] DemoTestCase/0.Test
//demo_file.cc:60: Failure
//Failed
//char type
//[ FAILED ] DemoTestCase/0.Test, where TypeParam = char (0 ms)
//[----------] 1 test from DemoTestCase/0 (0 ms total)
//
//[----------] 1 test from DemoTestCase/1, where TypeParam = int
//[ RUN ] DemoTestCase/1.Test
//[ OK ] DemoTestCase/1.Test (0 ms)
//[----------] 1 test from DemoTestCase/1 (0 ms total)
//
//[----------] 1 test from DemoTestCase/2, where TypeParam = unsigned int
//[ RUN ] DemoTestCase/2.Test
//demo_file.cc:60: Failure
//Failed
//unsigned int type
//[ FAILED ] DemoTestCase/2.Test, where TypeParam = unsigned int (0 ms)
//[----------] 1 test from DemoTestCase/2 (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 3 tests from 3 test cases ran. (0 ms total)
//[ PASSED ] 1 test.
//[ FAILED ] 2 tests, listed below:
//[ FAILED ] DemoTestCase/0.Test, where TypeParam = char
//[ FAILED ] DemoTestCase/2.Test, where TypeParam = unsigned int
//
// 2 FAILED TESTS
public void testTypedTestsSupport() {
mockModelUpdater.enterTestSuite("DemoTestCase/0(char)");
mockModelUpdater.enterTestCase("Test");
mockModelUpdater.addTestMessage("demo_file.cc", 60, ITestMessage.Level.Error, "Failed"+EOL+"char type");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestSuite("DemoTestCase/1(int)");
mockModelUpdater.enterTestCase("Test");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
mockModelUpdater.enterTestSuite("DemoTestCase/2(unsigned int)");
mockModelUpdater.enterTestCase("Test");
mockModelUpdater.addTestMessage("demo_file.cc", 60, ITestMessage.Level.Error, "Failed"+EOL+"unsigned int type");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//Running main() from gtest_main.cc
//Unknown line in the output
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//Another unknown line in the output
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest
//Yet another unknown line in the output
//[ OK ] DemoTestCase.DemoTest (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//One more unknown line in the output
//
//[----------] Global test environment tear-down
//And one more unknown line in the output
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testAllUnrecognizedLinesShouldBeSkipped() {
mockModelUpdater.enterTestSuite("DemoTestCase");
mockModelUpdater.enterTestCase("DemoTest");
mockModelUpdater.setTestingTime(0);
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//
public void testNoInput() {
// NOTE: The comment above is left blank intentionally
expectTestingException();
}
// This is not an input from a Google Test Module
public void testAbsolutelyIncorrectInput() {
expectTestingException();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] Not_A_DemoTestCase.DemoTest
public void testUnexpectedOutputEnd() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] Not_A_DemoTestCase.DemoTest
//[ OK ] DemoTestCase.DemoTest (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testTestSuiteNameMismatch1() {
mockModelUpdater.skipCalls("enterTestSuite");
expectTestingException();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest
//[ OK ] Not_A_DemoTestCase.DemoTest (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testTestSuiteNameMismatch2() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest
//[ OK ] DemoTestCase.DemoTest (0 ms)
//[----------] 1 test from Not_A_DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testTestSuiteNameMismatch3() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
mockModelUpdater.skipCalls("setTestingTime");
mockModelUpdater.skipCalls("setTestStatus");
mockModelUpdater.skipCalls("exitTestCase");
expectTestingException();
}
//Running main() from gtest_main.cc
//[==========] Running 1 test from 1 test case.
//[----------] Global test environment set-up.
//[----------] 1 test from DemoTestCase
//[ RUN ] DemoTestCase.DemoTest
//[ OK ] DemoTestCase.NOT_A_DemoTest (0 ms)
//[----------] 1 test from DemoTestCase (0 ms total)
//
//[----------] Global test environment tear-down
//[==========] 1 test from 1 test case ran. (0 ms total)
//[ PASSED ] 1 test.
public void testTestCaseNameMismatch() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
}

View file

@ -0,0 +1,221 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.testsrunners;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import junit.framework.Assert;
import org.eclipse.cdt.testsrunner.model.IModelVisitor;
import org.eclipse.cdt.testsrunner.model.ITestCase;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestItem.Status;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
import org.eclipse.cdt.testsrunner.model.ITestMessage.Level;
import org.eclipse.cdt.testsrunner.model.ITestModelUpdater;
import org.eclipse.cdt.testsrunner.model.ITestSuite;
/**
* Mock for the {@see ITestModelUpdater}.
*/
@SuppressWarnings("nls")
public class MockTestModelUpdater implements ITestModelUpdater {
private class FakeTestItem implements ITestItem {
private String name = null;
protected void unexpectedMethodCall() {
Assert.fail("Unexpected method call");
}
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void resetName() {
name = null;
}
// Unimplemented methods
@Override
public Status getStatus() { unexpectedMethodCall(); return null; }
@Override
public int getTestingTime() { unexpectedMethodCall(); return 0; }
@Override
public ITestSuite getParent() { unexpectedMethodCall(); return null; }
@Override
public boolean hasChildren() { unexpectedMethodCall(); return false; }
@Override
public ITestItem[] getChildren() { unexpectedMethodCall(); return null; }
@Override
public void visit(IModelVisitor visitor) { unexpectedMethodCall(); }
}
private class FakeTestCase extends FakeTestItem implements ITestCase {
@Override
public ITestMessage[] getTestMessages() { unexpectedMethodCall(); return null; }
}
private class FakeTestSuite extends FakeTestItem implements ITestSuite {
}
private class MethodInfo {
private String methodName;
private Object[] args;
MethodInfo(String methodName, Object[] args) {
this.methodName = methodName;
this.args = args;
}
private String genArgs(String methodName, Object[] args) {
StringBuilder sb = new StringBuilder();
sb.append(methodName);
sb.append("(");
boolean needDelimited = false;
for (Object arg : args) {
if (needDelimited) {
sb.append(", ");
} else {
needDelimited = true;
}
if (arg != null) {
sb.append('"');
sb.append(arg.toString());
sb.append('"');
} else {
sb.append("null");
}
}
sb.append(")");
return sb.toString();
}
public void check(String methodName, Object[] args) {
if (!this.methodName.equals(methodName)) {
Assert.failNotEquals("Unexpected method call. ",
genArgs(this.methodName, this.args), genArgs(methodName, args));
}
boolean compareFailed = (this.args.length != args.length);
if (!compareFailed) {
for (int i = 0; i < args.length; i++) {
if (this.args[i] == null) {
if (args[i] != null) {
compareFailed = true;
break;
}
} else if (!this.args[i].equals(args[i])) {
compareFailed = true;
break;
}
}
}
if (compareFailed) {
Assert.failNotEquals("Unexpected parameters of method "+this.methodName+"(). ",
genArgs(this.methodName, this.args), genArgs(methodName, args));
}
}
}
private LinkedList<MethodInfo> methodCalls = new LinkedList<MethodInfo>();
private boolean replayMode = false;
private Set<String> skippedMethods = new HashSet<String>();
// NOTE: Test suites nesting is not supported yet cause there is no need in it
private FakeTestSuite currentTestSuite = new FakeTestSuite();
private FakeTestCase currentTestCase = new FakeTestCase();
@Override
public void enterTestSuite(String name) {
genericImpl("enterTestSuite", name);
// NOTE: Test suites or cases nesting is not supported for mocking
currentTestSuite.setName(name);
}
@Override
public void exitTestSuite() {
genericImpl("exitTestSuite");
currentTestSuite.resetName();
}
@Override
public void enterTestCase(String name) {
genericImpl("enterTestCase", name);
currentTestCase.setName(name);
}
@Override
public void setTestStatus(Status status) {
genericImpl("setTestStatus", status);
}
@Override
public void setTestingTime(int testingTime) {
genericImpl("setTestingTime", testingTime);
}
@Override
public void exitTestCase() {
genericImpl("exitTestCase");
currentTestCase.resetName();
}
@Override
public void addTestMessage(String file, int line, Level level, String text) {
genericImpl("addTestMessage", file, line, level, text);
}
@Override
public ITestSuite currentTestSuite() {
return currentTestSuite;
}
@Override
public ITestCase currentTestCase() {
return currentTestCase;
}
public void skipCalls(String methodName) {
skippedMethods.add(methodName);
}
public void replay() {
replayMode = true;
}
private void genericImpl(String methodName, Object... args) {
if (!skippedMethods.contains(methodName)) {
if (replayMode) {
if (methodCalls.isEmpty()) {
Assert.fail("Unexpected method call "+methodName+"()");
} else {
methodCalls.pollFirst().check(methodName, args);
}
} else {
methodCalls.addLast(new MethodInfo(methodName, args));
}
}
}
}

View file

@ -0,0 +1,693 @@
/*******************************************************************************
* Copyright (c) 2011 Anton Gorenkov
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Anton Gorenkov - initial implementation
*******************************************************************************/
package org.eclipse.cdt.testsrunner.testsrunners;
import java.text.MessageFormat;
import org.eclipse.cdt.testsrunner.internal.qttest.QtTestsRunnerProvider;
import org.eclipse.cdt.testsrunner.launcher.ITestsRunnerProvider;
import org.eclipse.cdt.testsrunner.model.ITestItem;
import org.eclipse.cdt.testsrunner.model.ITestMessage;
/**
* Test for {@see QtTestsRunner} class
*/
@SuppressWarnings("nls")
public class QtTestCase extends BaseTestCase {
private static final String DEFAULT_LOCATION_FILE = "";
private static final int DEFAULT_LOCATION_LINE = 0;
@Override
protected ITestsRunnerProvider createTestsRunner() {
return new QtTestsRunnerProvider();
}
private void addStandardBenchmarkMessage(int value, String units, int iterations) {
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Info,
MessageFormat.format("{0,number,#.####} {1} per iteration (total: {2}, iterations: {3})",
((float)value)/iterations, units, value, iterations)
);
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testNoCustomTestCases() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testTheOnlyPassingCustomTestCase() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<Incident type="fail" file="qt_test_demo.cpp" line="6">
// <Description><![CDATA[Compared values are not the same
// Actual (1): 1
// Expected (2): 2]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testTheOnlyFailingCustomTestCase() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 6, ITestMessage.Level.FatalError,
"Compared values are not the same\n Actual (1): 1\n Expected (2): 2");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<Incident type="fail" file="qtestcase.cpp" line="1675">
// <Description><![CDATA[Caught unhandled exception]]></Description>
//</Incident>
//</TestFunction>
//</TestCase>
public void testTheOnlyAbortedCustomTestCase() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo");
mockModelUpdater.addTestMessage("qtestcase.cpp", 1675, ITestMessage.Level.FatalError,
"Caught unhandled exception");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
// NOTE: Qt.Test does not run any other test cases after exception throwing in a test case
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testWarning">
//<Message type="warn" file="" line="0">
// <Description><![CDATA[Test warning!]]></Description>
//</Message>
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testFailure">
//<Incident type="fail" file="qt_test_demo.cpp" line="41">
// <Description><![CDATA[Test fail!]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="testSkip">
//<Message type="skip" file="qt_test_demo.cpp" line="47">
// <Description><![CDATA[Test skip!]]></Description>
//</Message>
//</TestFunction>
//<TestFunction name="testExpectedFailWithContinue">
//<Incident type="xfail" file="qt_test_demo.cpp" line="60">
// <Description><![CDATA[Will fix in the next release]]></Description>
//</Incident>
//<Incident type="fail" file="qt_test_demo.cpp" line="61">
// <Description><![CDATA[Failed!]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="testExpectedFailWithAbort">
//<Incident type="xfail" file="qt_test_demo.cpp" line="68">
// <Description><![CDATA[Will fix in the next release]]></Description>
//</Incident>
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testExpectedFailPassed">
//<Incident type="xpass" file="qt_test_demo.cpp" line="70">
// <Description><![CDATA[COMPARE()]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="testUnknownIncidentType">
//<Incident type="??????" file="qt_test_demo.cpp" line="72">
// <Description><![CDATA[Unknown incident test!]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="testUnknownMessageType">
//<Message type="??????" file="qt_test_demo.cpp" line="80">
// <Description><![CDATA[Unknown message type test!]]></Description>
//</Message>
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testDifferentMessageLevels() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testWarning");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Warning, "Test warning!");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testFailure");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 41, ITestMessage.Level.FatalError, "Test fail!");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testSkip");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 47, ITestMessage.Level.Info, "Test skip!");
mockModelUpdater.setTestStatus(ITestItem.Status.Skipped);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testExpectedFailWithContinue");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 60, ITestMessage.Level.Error, "Will fix in the next release");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 61, ITestMessage.Level.FatalError, "Failed!");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testExpectedFailWithAbort");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 68, ITestMessage.Level.Error, "Will fix in the next release");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testExpectedFailPassed");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 70, ITestMessage.Level.Error, "COMPARE()");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testUnknownIncidentType");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 72, ITestMessage.Level.FatalError, "Unknown incident test!");
mockModelUpdater.setTestStatus(ITestItem.Status.Aborted);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testUnknownMessageType");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 80, ITestMessage.Level.FatalError, "Unknown message type test!");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<BenchmarkResult metric="walltime" tag="" value="28" iterations="8192" />
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testBenchmarkBasicSupport() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo");
addStandardBenchmarkMessage(28, "msec", 8192);
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<BenchmarkResult metric="callgrind" tag="locale aware compare" value="30" iterations="8192" />
//<BenchmarkResult metric="callgrind" tag="standard compare" value="24" iterations="10485" />
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testBenchmarkWithDataTag() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(locale aware compare)");
addStandardBenchmarkMessage(30, "instr.", 8192);
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(standard compare)");
addStandardBenchmarkMessage(24, "instr.", 10485);
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<Incident type="fail" file="qt_test_demo.cpp" line="57">
// <DataTag><![CDATA[locale aware compare]]></DataTag>
// <Description><![CDATA[Failed!]]></Description>
//</Incident>
//<Incident type="fail" file="qt_test_demo.cpp" line="57">
// <DataTag><![CDATA[locale aware compare]]></DataTag>
// <Description><![CDATA[Failed!]]></Description>
//</Incident>
//<BenchmarkResult metric="cputicks" tag="locale aware compare" value="29" iterations="8192" />
//<Incident type="fail" file="qt_test_demo.cpp" line="58">
// <DataTag><![CDATA[standard compare]]></DataTag>
// <Description><![CDATA[Failed!]]></Description>
//</Incident>
//<Incident type="fail" file="qt_test_demo.cpp" line="58">
// <DataTag><![CDATA[standard compare]]></DataTag>
// <Description><![CDATA[Failed!]]></Description>
//</Incident>
//<BenchmarkResult metric="cputicks" tag="standard compare" value="24" iterations="10485" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testBenchmarkMixedWithIncidentsWithDataTag() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(locale aware compare)");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 57, ITestMessage.Level.FatalError, "Failed!");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 57, ITestMessage.Level.FatalError, "Failed!");
addStandardBenchmarkMessage(29, "ticks", 8192);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(standard compare)");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 58, ITestMessage.Level.FatalError, "Failed!");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 58, ITestMessage.Level.FatalError, "Failed!");
addStandardBenchmarkMessage(24, "ticks", 10485);
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<Incident type="fail" file="qt_test_demo.cpp" line="20">
// <DataTag><![CDATA[all lower]]></DataTag>
// <Description><![CDATA[Compared values are not the same
// Actual (string.toUpper()): HELLO
// Expected (result): HELLO2]]></Description>
//</Incident>
//<Incident type="fail" file="qt_test_demo.cpp" line="20">
// <DataTag><![CDATA[mixed]]></DataTag>
// <Description><![CDATA[Compared values are not the same
// Actual (string.toUpper()): HELLO
// Expected (result): HELLO3]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testIncidentWithDataTag() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(all lower)");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 20, ITestMessage.Level.FatalError,
"Compared values are not the same\n Actual (string.toUpper()): HELLO\n Expected (result): HELLO2");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(mixed)");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 20, ITestMessage.Level.FatalError,
"Compared values are not the same\n Actual (string.toUpper()): HELLO\n Expected (result): HELLO3");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testDemo">
//<Message type="warn" file="" line="0">
// <DataTag><![CDATA[all lower]]></DataTag>
// <Description><![CDATA[hello]]></Description>
//</Message>
//<Incident type="fail" file="qt_test_demo.cpp" line="66">
// <DataTag><![CDATA[all lower]]></DataTag>
// <Description><![CDATA[HELLO2]]></Description>
//</Incident>
//<Message type="warn" file="" line="0">
// <DataTag><![CDATA[mixed]]></DataTag>
// <Description><![CDATA[Hello]]></Description>
//</Message>
//<Incident type="fail" file="qt_test_demo.cpp" line="66">
// <DataTag><![CDATA[mixed]]></DataTag>
// <Description><![CDATA[HELLO3]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testMessageWithDataTag() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(all lower)");
mockModelUpdater.addTestMessage("", 0, ITestMessage.Level.Warning, "hello");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 66, ITestMessage.Level.FatalError, "HELLO2");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testDemo(mixed)");
mockModelUpdater.addTestMessage("", 0, ITestMessage.Level.Warning, "Hello");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 66, ITestMessage.Level.FatalError, "HELLO3");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testWithEmptyIncident">
//<Incident type="fail" file="qt_test_demo.cpp" line="6">
// <Description><![CDATA[]]></Description>
//</Incident>
//</TestFunction>
//<TestFunction name="testWithEmptyMessage">
//<Message type="warn" file="" line="0">
// <Description><![CDATA[]]></Description>
//</Message>
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testWithEmptyMessage() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testWithEmptyIncident");
mockModelUpdater.addTestMessage("qt_test_demo.cpp", 6, ITestMessage.Level.FatalError, "");
mockModelUpdater.setTestStatus(ITestItem.Status.Failed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testWithEmptyMessage");
mockModelUpdater.addTestMessage(DEFAULT_LOCATION_FILE, DEFAULT_LOCATION_LINE, ITestMessage.Level.Warning, "");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//<TestFunction name="testWithoutAnyIncidents">
//</TestFunction>
//<TestFunction name="cleanupTestCase">
//<Incident type="pass" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testWithoutAnyIncidents() {
mockModelUpdater.enterTestSuite("MainTS");
mockModelUpdater.enterTestCase("initTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("testWithoutAnyIncidents");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.enterTestCase("cleanupTestCase");
mockModelUpdater.setTestStatus(ITestItem.Status.Passed);
mockModelUpdater.exitTestCase();
mockModelUpdater.exitTestSuite();
}
//
public void testNoInput() {
// NOTE: The comment above is left blank intentionally
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2 <!-- QTestVersion is not closed -->
//</Environment>
//</TestCase>
public void testBadFormedXml() {
mockModelUpdater.skipCalls("enterTestSuite");
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
public void testUnexceptedXmlEnd() {
mockModelUpdater.skipCalls("enterTestSuite");
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="some_wrong_value" file="" line="0" />
//</TestFunction>
//</TestCase>
public void testBadIncidentTypeValue() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Message type="some_wrong_value" file="" line="0">
// <Description><![CDATA[Test warning!]]></Description>
//</Message>
//</TestFunction>
//</TestCase>
public void testBadMessageTypeValue() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Incident type="some_wrong_value" file="" line="<wrong_value>" />
//</TestFunction>
//</TestCase>
public void testBadLineNumberValueOfIncident() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="initTestCase">
//<Message type="warn" file="" line="<wrong_value>">
// <Description><![CDATA[Test warning!]]></Description>
//</Message>
//</TestFunction>
//</TestCase>
public void testBadLineNumberValueOfMessage() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
//<?xml version="1.0" encoding="ISO-8859-1"?>
//<TestCase name="MainTS">
//<Environment>
// <QtVersion>4.6.2</QtVersion>
// <QTestVersion>4.6.2</QTestVersion>
//</Environment>
//<TestFunction name="testDemo">
//<BenchmarkResult metric="<wrong_value>" tag="" value="28" iterations="8192" />
//</TestFunction>
//</TestCase>
public void testBadBenchmarkMetricValue() {
mockModelUpdater.skipCalls("enterTestSuite");
mockModelUpdater.skipCalls("enterTestCase");
expectTestingException();
}
}

View file

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<project name="testsuite" default="run" basedir=".">
<!-- The property ${eclipse-home} should be passed into this script -->
<!-- Set a meaningful default value for when it is not. -->
<property name="eclipse-home" value="${basedir}"/>
<!-- This is the default name of the org.eclipse.test plugin. -->
<!-- We need to be able to override this for the case where the -->
<!-- org.eclipse.test plugin was build as part of a feature and -->
<!-- will have a name similar to org.eclipse.test_2.1.0 -->
<property name="org.eclipse.test" value="org.eclipse.test"/>
<!-- sets the properties eclipse-home, and library-file -->
<property name="plugin-name" value="org.eclipse.cdt.testsrunner.test"/>
<property name="library-file"
value="${eclipse-home}/plugins/${org.eclipse.test}/library.xml"/>
<!-- This target holds all initialization code that needs to be done for -->
<!-- all tests that are to be run. Initialization for individual tests -->
<!-- should be done within the body of the suite target. -->
<target name="init">
<tstamp/>
<delete>
<fileset dir="${eclipse-home}" includes="org*.xml"/>
</delete>
</target>
<!-- This target defines the tests that need to be run. -->
<target name="suite">
<property name="cdt-folder"
value="${eclipse-home}/cdt_folder"/>
<delete dir="${cdt-folder}" quiet="true"/>
<ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
<property name="data-dir" value="${cdt-folder}"/>
<property name="plugin-name" value="${plugin-name}"/>
<property name="classname"
value="org.eclipse.cdt.testsrunner.test.TestsRunnerSuite"/>
</ant>
</target>
<!-- This target holds code to cleanup the testing environment after -->
<!-- after all of the tests have been run. You can use this target to -->
<!-- delete temporary files that have been created. -->
<target name="cleanup">
</target>
<!-- This target runs the test suite. Any actions that need to happen -->
<!-- after all the tests have been run should go here. -->
<target name="run" depends="init,suite,cleanup">
<ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
<property name="includes" value="org*.xml"/>
<property name="output-file" value="${plugin-name}.xml"/>
</ant>
</target>
</project>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.cdt.testsrunner</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,82 @@
#Mon Apr 16 13:01:24 EEST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -0,0 +1,37 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.testsrunner;singleton:=true
Bundle-Version: 7.0.0.qualifier
Bundle-Activator: org.eclipse.cdt.testsrunner.internal.TestsRunnerPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.cdt.core;bundle-version="5.1.0",
org.eclipse.core.resources;bundle-version="3.5.0",
org.eclipse.debug.ui;bundle-version="3.5.0",
org.eclipse.cdt.debug.core;bundle-version="6.0.0",
org.eclipse.cdt.debug.ui,
org.eclipse.cdt.ui,
org.eclipse.cdt.dsf.gdb.ui,
org.eclipse.cdt.dsf.gdb
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.cdt.dsf.gdb.launching,
org.eclipse.cdt.internal.ui.viewsupport,
org.eclipse.cdt.launch,
org.eclipse.cdt.launch.internal.ui,
org.eclipse.cdt.launch.ui,
org.eclipse.core.filesystem,
org.eclipse.jface.text,
org.eclipse.ui.ide,
org.eclipse.ui.texteditor
Export-Package: org.eclipse.cdt.testsrunner.internal,
org.eclipse.cdt.testsrunner.internal.launcher,
org.eclipse.cdt.testsrunner.internal.model,
org.eclipse.cdt.testsrunner.internal.ui.launcher,
org.eclipse.cdt.testsrunner.internal.ui.view,
org.eclipse.cdt.testsrunner.internal.ui.view.actions,
org.eclipse.cdt.testsrunner.launcher,
org.eclipse.cdt.testsrunner.model

View file

@ -0,0 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>June 22, 2007</p>
<h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html>

View file

@ -0,0 +1,23 @@
###############################################################################
# Copyright (c) 2011 Anton Gorenkov
# 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
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Anton Gorenkov - Initial implementation
###############################################################################
bin.includes = plugin.xml,\
plugin.properties,\
icons/,\
about.html,\
.,\
META-INF/
javadoc.packages = org.eclipse.cdt.launch.ui.*,\
org.eclipse.cdt.launch.sourcelookup*,\
org.eclipse.cdt.launch.*
source.. = src/
src.includes = about.html,\
schema/

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Some files were not shown because too many files have changed in this diff Show more