1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Merge branch 'master' into sd90

This commit is contained in:
Andrew Gvozdev 2011-11-01 23:19:32 -04:00
commit 9cc7592a82
449 changed files with 7431 additions and 3547 deletions

View file

@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gnu.build"
label="%featureName"
version="8.0.0.qualifier"
version="8.1.0.qualifier"
provider-name="%providerName">
<description>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -2,7 +2,7 @@
<feature
id="org.eclipse.cdt.gnu.build.source"
label="%featureName"
version="8.0.0.qualifier"
version="8.1.0.qualifier"
provider-name="%providerName">
<description>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -2,6 +2,6 @@
<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/J2SE-1.5"/>
<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

@ -1,9 +1,9 @@
#Thu Apr 29 13:28:18 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -84,7 +84,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -15,5 +15,5 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.cdt.core.tests
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.core.filesystem

View file

@ -2,6 +2,6 @@
<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/J2SE-1.5"/>
<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

@ -1,9 +1,9 @@
#Thu Apr 29 13:15:20 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -80,7 +80,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -25,5 +25,5 @@ Require-Bundle: org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.core.filesystem;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.ibm.icu.text

View file

@ -19,6 +19,6 @@ src.includes = schema/,\
source.. = src/
jre.compilation.profile=J2SE-1.5
javacSource=1.5
javacTarget=1.5
jre.compilation.profile=JavaSE-1.6
javacSource=1.6
javacTarget=1.6

View file

@ -122,7 +122,7 @@
<scannerInfoProvider providerId="specsFile">
<run
command="gcc"
arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
arguments="-E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;"
class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
<scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
</scannerInfoProvider>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,9 +1,9 @@
#Thu Apr 29 13:15:20 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -80,7 +80,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -30,7 +30,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.make.core;bundle-version="[7.0.0,8.0.0)",
org.eclipse.cdt.make.core;bundle-version="[7.0.0,8.1.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
@ -38,5 +38,5 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="1.2.0",
org.eclipse.ui.console;bundle-version="3.5.100"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.ibm.icu.text

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -2,7 +2,7 @@
<classpath>
<classpathentry kind="src" path="tests"/>
<classpathentry kind="src" path="suite"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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="output" path="bin"/>
</classpath>

View file

@ -1,9 +1,9 @@
#Thu Oct 08 20:38:59 EDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -84,7 +84,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -22,4 +22,4 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.cdt.managedbuilder.gnu.ui,
org.eclipse.cdt.core.tests;bundle-version="5.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -45,7 +45,7 @@
</dependency>
<dependency>
<artifactId>org.eclipse.cdt.feature.group</artifactId>
<version>8.0.0.${buildQualifier}</version>
<version>8.1.0.${buildQualifier}</version>
<type>p2-installable-unit</type>
</dependency>
</dependencies>

View file

@ -2,6 +2,6 @@
<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/J2SE-1.5"/>
<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

@ -1,9 +1,9 @@
#Thu Apr 29 13:15:20 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -80,7 +80,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -37,5 +37,5 @@ Require-Bundle: org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.make.core;visibility:=reexport,
org.eclipse.core.filesystem;bundle-version="1.2.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.ibm.icu.text

View file

@ -17,6 +17,6 @@ src.includes = schema/,\
about.html
source.. = src/
jre.compilation.profile=J2SE-1.5
javacSource=1.5
javacTarget=1.5
jre.compilation.profile=JavaSE-1.6
javacSource=1.6
javacTarget=1.6

View file

@ -86,7 +86,7 @@
</buildOutputProvider>
<scannerInfoProvider providerId="specsFile">
<run
arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}"
arguments="-E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;"
command="gcc"
class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
<scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
@ -105,7 +105,7 @@
</buildOutputProvider>
<scannerInfoProvider providerId="specsFile">
<run
arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp"
arguments="-E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;"
command="g++"
class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
<scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
@ -124,7 +124,7 @@
</buildOutputProvider>
<scannerInfoProvider providerId="specsFile">
<run
arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
arguments="-E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;"
command="gcc"
class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
<scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1057,6 +1057,11 @@ public class Builder extends HoldsOptions implements IBuilder, IMatchKeyProvider
}
private String addCmd(String args, String cmd){
// Don't modify the args parameter if the cmd to add is emtpy.
// Bug 360846
if(cmd.length() == 0)
return args;
if(getCmdIndex(args, cmd) == -1){
if(args.length() != 0){
args += ' ';

View file

@ -2,6 +2,6 @@
<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/J2SE-1.5"/>
<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

@ -1,9 +1,9 @@
#Thu Apr 29 13:15:20 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -80,7 +80,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -11,8 +11,8 @@ Export-Package: org.eclipse.cdt.managedbuilder.gnu.cygwin,
org.eclipse.cdt.managedbuilder.gnu.templates;x-internal:=true,
org.eclipse.cdt.managedbuilder.gnu.ui
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.0.0,9.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.1.0,9.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.core.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -16,7 +16,7 @@ bin.includes = plugin.xml,\
templates/
source.. = src/
jre.compilation.profile=J2SE-1.5
javacSource=1.5
javacTarget=1.5
jre.compilation.profile=JavaSE-1.6
javacSource=1.6
javacTarget=1.6
src.includes = about.html

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,9 +1,9 @@
#Thu Apr 29 13:28:18 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -84,7 +84,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Managed Build UI Tests Plug-in
Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.ui.tests; singleton:=true
Bundle-Version: 8.0.0.qualifier
Bundle-Version: 8.1.0.qualifier
Bundle-Activator: org.eclipse.cdt.managedbuilder.ui.tests.testplugin.TestsPlugin
Bundle-Vendor: Eclipse CDT
Bundle-Localization: plugin
@ -15,4 +15,4 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.cdt.core,
org.eclipse.core.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -7,11 +7,11 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.managedbuilder.ui.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>

View file

@ -2,6 +2,6 @@
<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/J2SE-1.5"/>
<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

@ -1,9 +1,9 @@
#Thu Apr 29 13:15:20 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -80,7 +80,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

View file

@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.core;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.ui;bundle-version="[5.0.0,6.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.0.0,9.0.0)",
org.eclipse.cdt.managedbuilder.core;bundle-version="[8.1.0,9.0.0)",
org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.variables;bundle-version="[3.1.100,4.0.0)",
org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
@ -24,5 +24,5 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)",
org.eclipse.cdt.make.ui,
org.eclipse.core.filesystem
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.ibm.icu.text

View file

@ -18,6 +18,6 @@ src.includes = schema/,\
about.html
source.. = src/
jre.compilation.profile=J2SE-1.5
javacSource=1.5
javacTarget=1.5
jre.compilation.profile=JavaSE-1.6
javacSource=1.6
javacTarget=1.6

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,9 +1,9 @@
#Wed Feb 23 19:43:34 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -72,7 +72,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.checkers
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.cdt.codan.internal.checkers.ui;x-internal:=true,
org.eclipse.cdt.codan.internal.checkers.ui.quickfix;x-internal:=true

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,9 +1,9 @@
#Wed Feb 23 19:43:41 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -72,7 +72,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.cdt.core;bundle-version="5.1.0",
org.eclipse.cdt.codan.core.cxx;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.cdt.codan.checkers,
org.eclipse.cdt.codan.internal.checkers;x-friends:="org.eclipse.cdt.codan.checkers.ui,org.eclipse.cdt.codan.core.test"

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,9 +1,9 @@
#Wed Feb 23 19:43:49 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -72,7 +72,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -13,5 +13,5 @@ Export-Package: org.eclipse.cdt.codan.core.cxx,
org.eclipse.cdt.codan.core.cxx.internal.model;x-friends:="org.eclipse.cdt.codan.checkers.ui,org.eclipse.cdt.codan.ui,org.eclipse.cdt.codan.ui.cxx",
org.eclipse.cdt.codan.core.cxx.internal.model.cfg;x-friends:="org.eclipse.cdt.codan.core.test",
org.eclipse.cdt.codan.core.cxx.model
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,8 +1,8 @@
#Wed Feb 23 19:43:55 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
@ -68,7 +68,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -20,7 +20,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui.ide;bundle-version="3.6.0",
org.eclipse.cdt.codan.ui.cxx;bundle-version="2.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.cdt.codan.core.cfg,
org.eclipse.cdt.codan.core.cxx,

View file

@ -17,5 +17,5 @@ bin.includes = META-INF/,\
test.xml,\
OSGI-INF/,\
about.html
jre.compilation.profile = J2SE-1.5
jre.compilation.profile = JavaSE-1.6
src.includes = about.html

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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

@ -1,9 +1,9 @@
#Wed Feb 23 19:43:25 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -87,7 +87,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -8,7 +8,7 @@ Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.core.model,
org.eclipse.cdt.codan.core.model.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.checkers",

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,11 +1,11 @@
#Wed Feb 23 19:44:14 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.cdt.ui;bundle-version="5.2.0",
org.eclipse.core.resources;bundle-version="3.6.0",
org.eclipse.ui.editors;bundle-version="3.6.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.cdt.codan.ui.cfgview;x-internal:=true,
org.eclipse.cdt.codan.ui.cfgview.views;x-internal:=true

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -1,6 +1,6 @@
<?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/J2SE-1.5"/>
<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"/>

View file

@ -1,9 +1,9 @@
#Sun Feb 27 22:29:21 EST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -72,7 +72,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
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.5
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0

View file

@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.ide,
org.eclipse.cdt.ui,
org.eclipse.core.filesystem
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.cdt.codan.internal.ui;x-friends:="org.eclipse.cdt.codan.ui.cxx",
org.eclipse.cdt.codan.internal.ui.actions;x-friends:="org.eclipse.cdt.codan.ui.cxx",

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -13,6 +13,7 @@ package org.eclipse.cdt.codan.internal.ui.preferences;
import java.text.MessageFormat;
import org.eclipse.cdt.codan.core.CodanRuntime;
import org.eclipse.cdt.codan.core.PreferenceConstants;
import org.eclipse.cdt.codan.core.model.CodanSeverity;
import org.eclipse.cdt.codan.core.model.IProblem;
@ -332,16 +333,18 @@ public class ProblemsTreeEditor extends CheckedTreeEditor {
@Override
protected void doLoadDefault() {
if (getTreeControl() != null) {
CodanPreferencesLoader defaultPreferences = new CodanPreferencesLoader(CodanRuntime.getInstance().getCheckersRegistry().getDefaultProfile());
IProblem[] probs = codanPreferencesLoader.getProblems();
for (int i = 0; i < probs.length; i++) {
String id = probs[i].getId();
String s = getPreferenceStore().getDefaultString(id);
if (s == null || s.length() == 0) {
s = codanPreferencesLoader.getProperty(id);
s = defaultPreferences.getProperty(id);
}
codanPreferencesLoader.setProperty(id, s);
}
getViewer().setInput(codanPreferencesLoader.getInput());
setPresentsDefaultValue(true);
}
}

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,5 +7,5 @@ Bundle-ClassPath: cdt_linux.jar
Bundle-Vendor: %providerName
Fragment-Host: org.eclipse.cdt.core;bundle-version="[5.2.0,6.0.0)"
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.4
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-PlatformFilter: (osgi.os=linux)

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -7,7 +7,7 @@
<parent>
<groupId>org.eclipse.cdt</groupId>
<artifactId>cdt-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
<version>8.1.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View file

@ -6,7 +6,7 @@
<classpathentry kind="src" path="suite"/>
<classpathentry kind="src" path="regression"/>
<classpathentry kind="src" path="templateengine"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<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="output" path="bin"/>
</classpath>

View file

@ -1,9 +1,9 @@
#Wed Jan 02 10:16:52 EST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
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
@ -59,4 +59,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -48,4 +48,4 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.ltk.core.refactoring;bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse CDT
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -28,9 +28,9 @@ source.. = model/,\
regression/,\
templateengine/
jre.compilation.profile=J2SE-1.5
javacSource=1.5
javacTarget=1.5
jre.compilation.profile=JavaSE-1.6
javacSource=1.6
javacTarget=1.6
javacProjectSettings=true
src.includes = about.html

View file

@ -524,7 +524,8 @@ public class AST2CPPSpecTest extends AST2SpecBaseTest {
// struct Base::Datum; // error: Datum undefined
// struct Base::Data* pBase; // OK: refers to nested Data
public void test3_4_4s3() throws Exception {
parse(getAboveComment(), ParserLanguage.CPP, true, 0);
String[] problems= {"::Glob", "Glob", "Base::Datum", "Datum"};
parse(getAboveComment(), ParserLanguage.CPP, problems);
}
// static void f();

View file

@ -9351,6 +9351,22 @@ public class AST2CPPTests extends AST2BaseTest {
parseAndCheckBindings();
}
// struct S {
// void f();
// };
// struct Vector {
// S* begin();
// };
// void test() {
// Vector v;
// for (auto e : v) {
// e.f();
// }
// }
public void testAutoTypeInRangeBasedFor_359653() throws Exception {
parseAndCheckBindings();
}
// typedef int T;
// struct B {
// int a, b;
@ -9538,4 +9554,32 @@ public class AST2CPPTests extends AST2BaseTest {
public void testAmbiguityResolution_Bug359364() throws Exception {
parseAndCheckBindings();
}
// template<typename T> struct C {
// C(const C<T>& c) {}
// };
// struct D {
// typedef const D& TD;
// D(TD c) {}
// };
// struct E {
// E();
// };
// typedef E F;
// F::E(){}
public void testImplicitCtors_360223() throws Exception {
BindingAssertionHelper bh= getAssertionHelper();
ICPPClassType c= bh.assertNonProblem("C", 0);
ICPPConstructor[] ctors = c.getConstructors();
assertEquals(1, ctors.length);
assertFalse(ctors[0].isImplicit());
c= bh.assertNonProblem("D", 0);
ctors = c.getConstructors();
assertEquals(1, ctors.length);
assertFalse(ctors[0].isImplicit());
IBinding ctor= bh.assertNonProblem("E(){}", 1);
assertTrue(ctor instanceof ICPPConstructor);
}
}

View file

@ -3761,17 +3761,17 @@ public class AST2TemplateTests extends AST2BaseTest {
// ~DumbPtr<T> ();
// };
// template <class T>
// DumbPtr<T>::DumbPtr<T>/**/ (const DumbPtr<T>& aObj) {
// DumbPtr<T>::DumbPtr/**/ (const DumbPtr<T>& aObj) {
// }
// template <class T>
// DumbPtr<T>::~DumbPtr<T>/**/ () {
// DumbPtr<T>::~DumbPtr/**/ () {
// }
public void testCtorWithTemplateID_259600() throws Exception {
final String code = getAboveComment();
parseAndCheckBindings(code);
BindingAssertionHelper bh= new BindingAssertionHelper(code, true);
ICPPConstructor ctor= bh.assertNonProblem("DumbPtr<T>/**/", 10);
ICPPMethod dtor= bh.assertNonProblem("~DumbPtr<T>/**/", 11);
ICPPConstructor ctor= bh.assertNonProblem("DumbPtr/**/", 7);
ICPPMethod dtor= bh.assertNonProblem("~DumbPtr/**/", 8);
}
// template <class T> class XT {
@ -5470,7 +5470,7 @@ public class AST2TemplateTests extends AST2BaseTest {
public void testTemplateTemplateParameterMatching_352859() throws Exception {
parseAndCheckBindings();
}
// template<typename T> T f();
// template<> int f() {
// return 0;
@ -5482,7 +5482,7 @@ public class AST2TemplateTests extends AST2BaseTest {
ICPPTemplateInstance inst= bh.assertNonProblem("f() {", 1);
assertSame(template, inst.getTemplateDefinition());
}
// template<typename T1,typename T2> class A{};
// template<typename T1> class A<T1, int>{};
// template<typename T2> class A<int, T2>{};
@ -5497,7 +5497,7 @@ public class AST2TemplateTests extends AST2BaseTest {
public void testExplicitSpecializationOfForbiddenAsImplicit_356818() throws Exception {
parseAndCheckBindings();
}
// struct A {
// void f() { }
// };
@ -5522,11 +5522,56 @@ public class AST2TemplateTests extends AST2BaseTest {
public void testSpecializationOfUsingDeclaration_357293() throws Exception {
parseAndCheckBindings();
}
// template<typename T> struct SS {};
// template<template<typename T, typename S = SS<T> > class Cont>
// Cont<int> f() {}
public void testReferenceToParameterOfTemplateTemplateParameter_357308() throws Exception {
parseAndCheckBindings();
}
// template <typename...> void f() {}
// void test() {
// f();
// f<>();
// }
public void testTemplateArgumentDeductionWithoutParameters_358654() throws Exception {
parseAndCheckBindings();
}
// template<bool V, typename T>
// struct C {
// typedef int s;
// };
//
// template<typename T>
// struct C<false, T> {
// typedef T s;
// };
//
// struct B {
// typedef B u;
// };
//
// struct C8 { char c[8]; };
//
// typedef C<sizeof(char) == sizeof(C8), B> r;
// typedef r::s t;
// t::u x;
public void testBoolExpressionAsTemplateArgument_361604() throws Exception {
final String code= getAboveComment();
parseAndCheckBindings(code);
}
// template<typename T> struct B {
// void m();
// };
// template<typename T> struct C : B<T> {
// using B<T*>::m;
// void m();
// };
// template<typename T> void C<T>::m() {}
public void testDependentUsingDeclaration() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -138,7 +138,13 @@ public class AST2Tests extends AST2BaseTest {
public AST2Tests(String name) {
super(name);
}
private void parseAndCheckBindings() throws Exception {
String code= getAboveComment();
parseAndCheckBindings(code, ParserLanguage.C);
parseAndCheckBindings(code, ParserLanguage.CPP);
}
protected IASTTranslationUnit parseAndCheckBindings(String code) throws Exception {
return parseAndCheckBindings(code, ParserLanguage.C);
}
@ -7360,4 +7366,13 @@ public class AST2Tests extends AST2BaseTest {
es= getStatement(a, 2);
assertEquals("unsigned long int", ASTTypeUtil.getType(es.getExpression().getExpressionType()));
}
// void foo(){
// typedef int foobar_t;
// foobar_t *a = 0, *b = a;
// }
public void testAmbiguousStatement_Bug360541() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -655,7 +655,7 @@ public class CompleteParser2Tests extends BaseTestCase {
public void testNestedClassname() throws Exception
{
IASTTranslationUnit tu = parse( "namespace A { } \n class A::B { };"); //$NON-NLS-1$
IASTTranslationUnit tu = parse( "namespace A { \n class A::B { };}"); //$NON-NLS-1$
CPPNameCollector col = new CPPNameCollector();
tu.accept( col );

View file

@ -1,13 +1,13 @@
/*******************************************************************************
* Copyright (c) 2004, 2008 IBM Corporation and others.
* Copyright (c) 2004, 2011 IBM Corporation 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:
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
* IBM - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.core.parser.tests.ast2;
@ -35,6 +35,7 @@ import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.ParserLanguage;
import org.eclipse.cdt.core.parser.ScannerInfo;
import org.eclipse.cdt.internal.core.dom.SavedCodeReaderFactory;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@ -70,9 +71,9 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
String code = "int main() { return BEAST * sizeof( Include ); } "; //$NON-NLS-1$
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "main.cc" : "main.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile c = importFile(filename, code); //$NON-NLS-1$ //$NON-NLS-2$
IFile c = importFile(filename, code);
IASTTranslationUnit tu = parse(c, scannerInfo); //$NON-NLS-1$
IASTTranslationUnit tu = parse(c, scannerInfo);
IASTFunctionDefinition fd = (IASTFunctionDefinition) tu.getDeclarations()[3];
IASTFileLocation floc = fd.getFileLocation();
assertEquals(floc.getNodeOffset(),
@ -102,11 +103,11 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "blah.cc" : "blah.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile source = importFile(filename, code); //$NON-NLS-1$
IASTTranslationUnit tu = parse(source); //$NON-NLS-1$
IFile source = importFile(filename, code);
IASTTranslationUnit tu = parse(source);
IASTSimpleDeclaration declaration = (IASTSimpleDeclaration) tu.getDeclarations()[0];
assertSoleFileLocation(declaration.getDeclarators()[0], filename,
code.indexOf("SomeStructure"), "SomeStructure".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
code.indexOf("SomeStructure"), "SomeStructure".length()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
@ -206,13 +207,13 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "code.cc" : "code.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile cpp = importFile(filename, code); //$NON-NLS-1$
IASTTranslationUnit tu = parse(cpp); //$NON-NLS-1$
IFile cpp = importFile(filename, code);
IASTTranslationUnit tu = parse(cpp);
IASTDeclaration[] declarations = tu.getDeclarations();
assertEquals(declarations.length, 2);
IASTSimpleDeclaration bar = (IASTSimpleDeclaration) declarations[0];
IASTSimpleDeclaration FOO = (IASTSimpleDeclaration) declarations[1];
assertSoleFileLocation(bar, filename, code.indexOf("int"), code.indexOf(";") + 1); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(bar, filename, code.indexOf("int"), code.indexOf(";") + 1); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(FOO, "foo.h", foo.indexOf("int"), foo.indexOf(";") + 1); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IASTPreprocessorIncludeStatement[] incs = tu.getIncludeDirectives();
@ -243,8 +244,8 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "code.cc" : "code.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile cpp = importFile(filename, code); //$NON-NLS-1$
IASTTranslationUnit tu = parse(cpp); //$NON-NLS-1$
IFile cpp = importFile(filename, code);
IASTTranslationUnit tu = parse(cpp);
IASTDeclaration[] declarations = tu.getDeclarations();
assertEquals(declarations.length, 3);
IASTSimpleDeclaration bar = (IASTSimpleDeclaration) declarations[0];
@ -253,21 +254,21 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
assertSoleFileLocation(
bar,
filename,
code.indexOf("int"), code.indexOf("r;") + 2 - code.indexOf("int")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
code.indexOf("int"), code.indexOf("r;") + 2 - code.indexOf("int")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(
FOO,
"foo.h", foo.indexOf("int"), foo.indexOf(";") + 1 - foo.indexOf("int")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
assertSoleFileLocation(
byob,
filename,
code.indexOf("float"), code.indexOf("b;") + 2 - code.indexOf("float")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
code.indexOf("float"), code.indexOf("b;") + 2 - code.indexOf("float")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
IASTPreprocessorIncludeStatement[] incs = tu.getIncludeDirectives();
assertNotNull(incs);
assertEquals(incs.length, 1);
assertSoleFileLocation(
incs[0],
filename,
code.indexOf("#inc"), code.indexOf(".h\"\n") + ".h\"".length() - code.indexOf("#inc")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
code.indexOf("#inc"), code.indexOf(".h\"\n") + ".h\"".length() - code.indexOf("#inc")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
}
@ -278,8 +279,8 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "blah.cc" : "blah.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile c_file = importFile(filename, c_file_code); //$NON-NLS-1$
IASTTranslationUnit tu = parse(c_file); //$NON-NLS-1$
IFile c_file = importFile(filename, c_file_code);
IASTTranslationUnit tu = parse(c_file);
assertEquals(tu.getDeclarations().length, 0);
IASTPreprocessorMacroDefinition[] macroDefinitions = tu
.getMacroDefinitions();
@ -288,9 +289,9 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
assertSoleFileLocation(
macroDefinitions[0],
filename,
c_file_code.indexOf("#define"), c_file_code.indexOf("4") + 1 - c_file_code.indexOf("#define")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
c_file_code.indexOf("#define"), c_file_code.indexOf("4") + 1 - c_file_code.indexOf("#define")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(macroDefinitions[0].getName(), filename,
c_file_code.indexOf("X"), 1); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
c_file_code.indexOf("X"), 1); //$NON-NLS-1$
assertSoleFileLocation(
macroDefinitions[1],
"blarg.h", h_file_code.indexOf("#define _BLARG_H_"), "#define _BLARG_H_".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@ -299,17 +300,17 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
"blarg.h", h_file_code.indexOf("e _BLARG_H_") + 2, "_BLARG_H_".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(
macroDefinitions[2],
"blarg.h", h_file_code.indexOf("#define PRINT(s,m) printf(s,m)\r"), "#define PRINT(s,m) printf(s,m)".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"blarg.h", h_file_code.indexOf("#define PRINT(s,m) printf(s,m)\r"), "#define PRINT(s,m) printf(s,m)".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(macroDefinitions[2].getName(),
"blarg.h", h_file_code.indexOf("PRINT"), "PRINT".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"blarg.h", h_file_code.indexOf("PRINT"), "PRINT".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(
macroDefinitions[3],
filename,
c_file_code.indexOf("#define POST_INCLUDE"), "#define POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
c_file_code.indexOf("#define POST_INCLUDE"), "#define POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(
macroDefinitions[3].getName(),
filename,
c_file_code.indexOf("POST_INCLUDE"), "POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
c_file_code.indexOf("POST_INCLUDE"), "POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@ -322,7 +323,7 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "source.cc" : "source.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile f = importFile(filename, cpp_code); //$NON-NLS-1$
IFile f = importFile(filename, cpp_code);
IASTTranslationUnit tu = parse(f);
IASTDeclaration[] declarations = tu.getDeclarations();
IASTPreprocessorIncludeStatement[] includeDirectives = tu
@ -330,7 +331,7 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
assertSoleFileLocation(
includeDirectives[0],
filename,
cpp_code.indexOf("#include \"header1.h\""), "#include \"header1.h\"".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
cpp_code.indexOf("#include \"header1.h\""), "#include \"header1.h\"".length()); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(declarations[0],
"header1.h", 0, "int x;".length()); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(declarations[1],
@ -338,9 +339,9 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
assertSoleFileLocation(
includeDirectives[1],
filename,
cpp_code.indexOf("#include \"header2.h\""), "#include \"header2.h\"".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
cpp_code.indexOf("#include \"header2.h\""), "#include \"header2.h\"".length()); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(declarations[2], filename, cpp_code
.indexOf("int z;"), "int z;".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
.indexOf("int z;"), "int z;".length()); //$NON-NLS-1$ //$NON-NLS-2$
IASTTranslationUnit.IDependencyTree tree = tu.getDependencyTree();
assertEquals(tree.getInclusions().length, 2);
@ -357,8 +358,8 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "blah.cc" : "blah.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile c_file = importFile(filename, c_file_code); //$NON-NLS-1$
IASTTranslationUnit tu = parse(c_file); //$NON-NLS-1$
IFile c_file = importFile(filename, c_file_code);
IASTTranslationUnit tu = parse(c_file);
assertEquals(tu.getDeclarations().length, 0);
IASTPreprocessorMacroDefinition[] macroDefinitions = tu.getMacroDefinitions();
assertNotNull(macroDefinitions);
@ -366,9 +367,9 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
assertSoleFileLocation(
macroDefinitions[0],
filename,
c_file_code.indexOf("#define"), c_file_code.indexOf("4") + 1 - c_file_code.indexOf("#define")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
c_file_code.indexOf("#define"), c_file_code.indexOf("4") + 1 - c_file_code.indexOf("#define")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(macroDefinitions[0].getName(), filename,
c_file_code.indexOf("X"), 1); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
c_file_code.indexOf("X"), 1); //$NON-NLS-1$
assertSoleFileLocation(
macroDefinitions[1],
"blarg.h", h_file_code.indexOf("#define _BLARG_H_"), "#define _BLARG_H_".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@ -377,24 +378,24 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
"blarg.h", h_file_code.indexOf("e _BLARG_H_") + 2, "_BLARG_H_".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(
macroDefinitions[2],
"blarg.h", h_file_code.indexOf("#define PRINT(s,m) printf(s,m)\r"), "#define PRINT(s,m) printf(s,m)".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"blarg.h", h_file_code.indexOf("#define PRINT(s,m) printf(s,m)\r"), "#define PRINT(s,m) printf(s,m)".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(macroDefinitions[2].getName(),
"blarg.h", h_file_code.indexOf("PRINT"), "PRINT".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"blarg.h", h_file_code.indexOf("PRINT"), "PRINT".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(
macroDefinitions[3],
filename,
c_file_code.indexOf("#define POST_INCLUDE"), "#define POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
c_file_code.indexOf("#define POST_INCLUDE"), "#define POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(
macroDefinitions[3].getName(),
filename,
c_file_code.indexOf("POST_INCLUDE"), "POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
c_file_code.indexOf("POST_INCLUDE"), "POST_INCLUDE".length()); //$NON-NLS-1$ //$NON-NLS-2$
assertSoleFileLocation(
macroDefinitions[4],
"second.h", h_file2_code.indexOf("#define _SECOND_H_"), "#define _SECOND_H_".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertSoleFileLocation(
macroDefinitions[5],
filename,
c_file_code.indexOf("#define POST_SECOND"), "#define POST_SECOND".length()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
c_file_code.indexOf("#define POST_SECOND"), "#define POST_SECOND".length()); //$NON-NLS-1$ //$NON-NLS-2$
}
}
@ -411,15 +412,15 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
buffer.append("};\n"); //$NON-NLS-1$
buffer.append("#endif /*_INCLUDE_H_*/\n"); //$NON-NLS-1$
final String inc_file_code = buffer.toString();
IFile include_file = importFile("include.h", inc_file_code); //$NON-NLS-1$ //$NON-NLS-2$
IFile include_file = importFile("include.h", inc_file_code); //$NON-NLS-1$
String[] macros = { imacro_file.getLocation().toOSString() };
String[] includes = { include_file.getLocation().toOSString() };
IExtendedScannerInfo scannerInfo = new ExtendedScannerInfo(Collections.EMPTY_MAP, EMPTY_STRING_ARRAY, macros, includes);
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "main.cc" : "main.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile code = importFile(filename, "int main() { return BEAST * sizeof( Include ); } "); //$NON-NLS-1$ //$NON-NLS-2$
IASTTranslationUnit tu = parse(code, scannerInfo); //$NON-NLS-1$
IFile code = importFile(filename, "int main() { return BEAST * sizeof( Include ); } "); //$NON-NLS-1$
IASTTranslationUnit tu = parse(code, scannerInfo);
IASTPreprocessorMacroDefinition[] macro_defs = tu.getMacroDefinitions();
assertEquals(macro_defs.length, 2);
IASTPreprocessorMacroDefinition BEAST = macro_defs[0];
@ -443,8 +444,8 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "blah.cc" : "blah.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile f = importFile(filename, code); //$NON-NLS-1$
IASTTranslationUnit tu = parse(f); //$NON-NLS-1$
IFile f = importFile(filename, code);
IASTTranslationUnit tu = parse(f);
IASTProblem[] prbs = tu.getPreprocessorProblems();
assertEquals(prbs.length, 1);
IASTNodeLocation[] locs = prbs[0].getNodeLocations();
@ -474,16 +475,16 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
buffer.append("};\n"); //$NON-NLS-1$
buffer.append("#endif /*_INCLUDE_H_*/\n"); //$NON-NLS-1$
final String inc_file_code = buffer.toString();
IFile include_file = importFile("include.h", inc_file_code); //$NON-NLS-1$ //$NON-NLS-2$
IFile include_file = importFile("include.h", inc_file_code); //$NON-NLS-1$
String[] macros = { imacro_file.getLocation().toOSString() };
String[] includes = { include_file.getLocation().toOSString() };
IExtendedScannerInfo scannerInfo = new ExtendedScannerInfo(
Collections.EMPTY_MAP, EMPTY_STRING_ARRAY, macros, includes);
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "main.cc" : "main.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile code = importFile(filename, "int main() { return BEAST * sizeof( Include ); } "); //$NON-NLS-1$ //$NON-NLS-2$
IFile code = importFile(filename, "int main() { return BEAST * sizeof( Include ); } "); //$NON-NLS-1$
IASTTranslationUnit tu = parse(code, scannerInfo); //$NON-NLS-1$
IASTTranslationUnit tu = parse(code, scannerInfo);
IASTPreprocessorMacroDefinition[] macro_defs = tu.getMacroDefinitions();
assertEquals(macro_defs.length, 4);
IASTPreprocessorMacroDefinition BEAST = macro_defs[0];
@ -515,14 +516,14 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
buffer.append("};\n"); //$NON-NLS-1$
buffer.append("#endif /*_INCLUDE_H_*/\n"); //$NON-NLS-1$
final String inc_file_code = buffer.toString();
IFile include_file = importFile("include.h", inc_file_code); //$NON-NLS-1$ //$NON-NLS-2$
IFile include_file = importFile("include.h", inc_file_code); //$NON-NLS-1$
String[] macros = { imacro_file1.getLocation().toOSString(), imacro_file2.getLocation().toOSString() };
String[] includes = { include_file.getLocation().toOSString() };
IExtendedScannerInfo scannerInfo = new ExtendedScannerInfo(Collections.EMPTY_MAP, EMPTY_STRING_ARRAY, macros, includes);
for (ParserLanguage p : ParserLanguage.values()) {
String filename = (p == ParserLanguage.CPP) ? "main.cc" : "main.c"; //$NON-NLS-1$ //$NON-NLS-2$
IFile code = importFile(filename, "int main() { return BEAST * sizeof( Include ); } "); //$NON-NLS-1$ //$NON-NLS-2$
IFile code = importFile(filename, "int main() { return BEAST * sizeof( Include ); } "); //$NON-NLS-1$
IASTTranslationUnit tu = parse(code, scannerInfo);
IASTPreprocessorMacroDefinition[] macro_defs = tu.getMacroDefinitions();
@ -611,4 +612,182 @@ public class DOMLocationInclusionTests extends AST2FileBasePluginTest {
tmpFile.getParentFile().delete();
}
}
// // comment
//
// #ifndef guard
// #define guard
// bla bla
// #if 1
// #endif
// bla bla
// #endif
// //comment
// // comment
//
// #if !defined(guard)
// #define guard
// bla bla
// #if 1
// #endif
// bla bla
// #endif
// //comment
// // comment
//
// #if ((!defined guard))
// #define guard
// bla bla
// #if 1
// #endif
// bla bla
// #endif
// //comment
// // comment
// #pragma once
// // Some comment
//
// #ifndef AN_UNIQUE_INCLUDE_GUARD_H_
// #define AN_UNIQUE_INCLUDE_GUARD_H_
//
// #include <string>
//
// Some code without any macro references
//
// #endif // AN_UNIQUE_INCLUDE_GUARD_H_
public void testPragmaOnceDetection_197989a() throws Exception {
CharSequence[] contents= getContents(5);
int i= 0;
for (CharSequence content : contents) {
String headerName = i + ".h";
IFile base = importFile("base" + headerName, "#include \"" + headerName + "\"");
importFile(headerName, content.toString());
IASTTranslationUnit tu = parse(base, new ScannerInfo());
IASTPreprocessorIncludeStatement[] incs = tu.getIncludeDirectives();
assertTrue(incs.length > 0);
assertTrue(incs[0].hasPragmaOnceSemantics());
}
}
// #ifndef guard
// #define guard2
// #endif
// #if !defined guard
// #define guard2
// #endif
// #if !defined(guard) && !defined(guard2)
// #define guard
// #endif
// #if (0)
// #pragma once
// #endif
// leading
// #ifndef guard
// #define guard2
// #endif
// #ifndef guard
// #define guard2
// #endif
// #ifdef xx
// trailing
// #endif
public void testPragmaOnceDetection_197989b() throws Exception {
CharSequence[] contents= getContents(6);
int i= 0;
for (CharSequence content : contents) {
String headerName = i + ".h";
IFile base = importFile("base" + headerName, "#include \"" + headerName + "\"");
importFile(headerName, content.toString());
IASTTranslationUnit tu = parse(base, new ScannerInfo());
IASTPreprocessorIncludeStatement[] incs = tu.getIncludeDirectives();
assertEquals(1, incs.length);
assertFalse(incs[0].hasPragmaOnceSemantics());
}
}
// // header.h
// #ifdef AH
// #endif
// #ifndef BH
// #endif
// #define h
// #if CH || DH
// #elif EH==1
// #endif
// #define BH
// #define DH 0
// #define EH 1
// #include "header.h"
// #ifdef h // defined in header
// #endif
// #ifdef A
// #ifdef a // inactive
// #endif
// #else
// #ifndef B
// #endif
// #endif
// #if defined C
// #elif ((!((defined(D)))))
// #endif
// #define A
// #define B
// #define AH
// #define h
// #undef u
// #ifdef h // locally defined
// #endif
// #ifndef u // locally undefined
// #endif
public void testSignificantMacros_197989a() throws Exception {
CharSequence[] contents= getContents(2);
IFile h = importFile("header.h", contents[0].toString());
IFile c = importFile("source.c", contents[1].toString());
IASTTranslationUnit tu = parse(c, new ScannerInfo());
IASTPreprocessorIncludeStatement[] incs = tu.getIncludeDirectives();
assertEquals(1, incs.length);
assertEquals("{AH=null,BH=*,CH=null,DH=0,EH=1}",
incs[0].getSignificantMacros().toString());
assertEquals("{A=null,AH=null,B=null,C=null,CH=null,D=null}",
tu.getSignificantMacros().toString());
}
// // header.h
// #if EQ(A,B)
// #endif
// #define EQ(x,y) x==y
// #define A A1
// #define B 1
// #include "header.h"
public void testSignificantMacros_197989b() throws Exception {
CharSequence[] contents= getContents(2);
IFile h = importFile("header.h", contents[0].toString());
IFile c = importFile("source.c", contents[1].toString());
IASTTranslationUnit tu = parse(c, new ScannerInfo());
IASTPreprocessorIncludeStatement[] incs = tu.getIncludeDirectives();
assertEquals(1, incs.length);
assertEquals("{A=A1,A1=null,B=1,EQ=x==y}",
incs[0].getSignificantMacros().toString());
assertEquals("{A1=null}",
tu.getSignificantMacros().toString());
}
}

View file

@ -1,29 +1,29 @@
/*******************************************************************************
* Copyright (c) 2004, 2009 IBM Corporation and others.
* Copyright (c) 2004, 2011 IBM Corporation 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:
* IBM - Initial API and implementation
* IBM - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.tests.scanner;
import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.parser.FileContent;
import org.eclipse.cdt.internal.core.parser.IMacroDictionary;
import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContent;
import org.eclipse.cdt.internal.core.parser.scanner.InternalFileContentProvider;
public class FileCodeReaderFactory extends InternalFileContentProvider {
private static FileCodeReaderFactory instance;
private FileCodeReaderFactory() {}
@Override
public InternalFileContent getContentForInclusion(String path) {
public InternalFileContent getContentForInclusion(String path,
IMacroDictionary macroDictionary) {
return (InternalFileContent) FileContent.createForExternalFileLocation(path);
}

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.tests.scanner;
@ -37,10 +37,10 @@ import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorUndefStatement;
import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IMacroBinding;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit.IDependencyTree;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit.IDependencyTree.IASTInclusionNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IMacroBinding;
import org.eclipse.cdt.core.testplugin.CTestPlugin;
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
@ -49,8 +49,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTranslationUnit;
import org.eclipse.cdt.internal.core.parser.scanner.CharArray;
import org.eclipse.cdt.internal.core.parser.scanner.ILocationCtx;
import org.eclipse.cdt.internal.core.parser.scanner.ImageLocationInfo;
import org.eclipse.cdt.internal.core.parser.scanner.LocationMap;
import org.eclipse.cdt.internal.core.parser.scanner.Lexer.LexerOptions;
import org.eclipse.cdt.internal.core.parser.scanner.LocationMap;
public class LocationMapTests extends BaseTestCase {
public class Loc implements IASTFileLocation {
@ -80,6 +80,9 @@ public class LocationMapTests extends BaseTestCase {
public IASTFileLocation asFileLocation() {
return this;
}
public IASTPreprocessorIncludeStatement getContextInclusionStatement() {
return null;
}
}
private static final String FN = "filename";
@ -336,8 +339,8 @@ public class LocationMapTests extends BaseTestCase {
public void testIncludes() {
init(DIGITS);
fLocationMap.encounterPoundInclude(0, 0, 0, 0, "n1".toCharArray(), null, true, false, false);
fLocationMap.encounterPoundInclude(0, 1, 3, 16, "n2".toCharArray(), "f2", false , true, false);
fLocationMap.encounterPoundInclude(0, 0, 0, 0, "n1".toCharArray(), null, true, false, false, null);
fLocationMap.encounterPoundInclude(0, 1, 3, 16, "n2".toCharArray(), "f2", false , true, false, null);
IASTPreprocessorIncludeStatement[] includes= fLocationMap.getIncludeDirectives();
assertEquals(2, includes.length);
checkInclude(includes[0], "", "", "n1", "", true, false, FN, 0, 0, 1, 0, 0);

View file

@ -21,6 +21,7 @@ import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.index.IIndexLinkage;
import org.eclipse.cdt.core.index.IIndexMacro;
import org.eclipse.cdt.core.index.IndexFilter;
import org.eclipse.cdt.core.parser.ISignificantMacros;
import org.eclipse.cdt.internal.core.index.IIndexFragment;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
import org.eclipse.cdt.internal.core.index.IIndexFragmentFile;
@ -100,13 +101,24 @@ public class EmptyIndexFragment implements IIndexFragment {
return 0;
}
@Deprecated
public IIndexFragmentFile getFile(int linkageID, IIndexFileLocation location)
throws CoreException {
return null;
}
public IIndexFragmentFile getFile(int linkageID, IIndexFileLocation location,
ISignificantMacros sigMacros) throws CoreException {
return null;
}
public IIndexFragmentFile[] getFiles(int linkageID, IIndexFileLocation location)
throws CoreException {
return IIndexFragmentFile.EMPTY_ARRAY;
}
public IIndexFragmentFile[] getFiles(IIndexFileLocation location) throws CoreException {
return new IIndexFragmentFile[0];
return IIndexFragmentFile.EMPTY_ARRAY;
}
public long getLastWriteAccess() {

View file

@ -6,13 +6,16 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial implementation
* IBM Corporation
* Markus Schorn (Wind River Systems)
* Andrew Ferguson (Symbian) - Initial implementation
* IBM Corporation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.index.tests;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMManager;
@ -81,14 +84,19 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
}
protected IASTName findName(String section, int len) {
IASTTranslationUnit ast = strategy.getAst();
final IASTNodeSelector nodeSelector = ast.getNodeSelector(null);
final int offset = strategy.getTestData()[1].indexOf(section);
IASTName name= nodeSelector.findName(offset, len);
if (name == null)
name= nodeSelector.findImplicitName(offset, len);
for (int i = 0; i < strategy.getAstCount(); i++) {
IASTTranslationUnit ast = strategy.getAst(i);
final IASTNodeSelector nodeSelector = ast.getNodeSelector(null);
final int offset = strategy.getAstSource(i).indexOf(section);
if (offset >= 0) {
IASTName name= nodeSelector.findName(offset, len);
if (name == null)
name= nodeSelector.findImplicitName(offset, len);
return name;
}
}
return name;
return null;
}
/**
@ -210,7 +218,9 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
IIndex getIndex();
void setUp() throws Exception;
void tearDown() throws Exception;
public IASTTranslationUnit getAst();
public int getAstCount();
public IASTTranslationUnit getAst(int index);
public StringBuilder getAstSource(int index);
public StringBuilder[] getTestData();
public ICProject getCProject();
public boolean isCompositeIndex();
@ -258,13 +268,25 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
return testData;
}
public IASTTranslationUnit getAst() {
public int getAstCount() {
return 1;
}
public IASTTranslationUnit getAst(int index) {
if (index != 0)
throw new IllegalArgumentException();
return ast;
}
public StringBuilder getAstSource(int index) {
if (index != 0)
throw new IllegalArgumentException();
return testData[1];
}
public void setUp() throws Exception {
cproject = cpp ? CProjectHelper.createCCProject(getName()+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER)
: CProjectHelper.createCProject(getName()+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
cproject = cpp ? CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER)
: CProjectHelper.createCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
Bundle b = CTestPlugin.getDefault().getBundle();
testData = TestSourceReader.getContentsForTest(b, "parser", IndexBindingResolutionTestBase.this.getClass(), getName(), 2);
@ -275,7 +297,7 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
assertTrue(CCorePlugin.getIndexManager().joinIndexer(360000, new NullProgressMonitor()));
if (DEBUG) {
System.out.println("Project PDOM: "+getName());
System.out.println("Project PDOM: " + getName());
((PDOM)CCoreInternals.getPDOMManager().getPDOM(cproject)).accept(new PDOMPrettyPrinter());
}
@ -304,7 +326,6 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
}
}
class SinglePDOMTestStrategy implements ITestStrategy {
private IIndex index;
private ICProject cproject;
@ -324,10 +345,22 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
return testData;
}
public IASTTranslationUnit getAst() {
public int getAstCount() {
return 1;
}
public IASTTranslationUnit getAst(int index) {
if (index != 0)
throw new IllegalArgumentException();
return ast;
}
public StringBuilder getAstSource(int index) {
if (index != 0)
throw new IllegalArgumentException();
return testData[1];
}
public void setUp() throws Exception {
cproject = cpp ? CProjectHelper.createCCProject(getName()+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER)
: CProjectHelper.createCProject(getName()+System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
@ -370,6 +403,108 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
}
}
/**
* This strategy allows tests to create an arbitrary number of header and source files
* and to obtain ASTs of any subset of the created files.
*
* The first line of each comment section preceding the test contains the name of the file
* to put the contents of the section to. To request the AST of a file, put an asterisk after
* the file name.
*/
class SinglePDOMTestNamedFilesStrategy implements ITestStrategy {
private IIndex index;
private ICProject cproject;
private StringBuilder[] testData;
private final List<StringBuilder> astSources;
private final List<IASTTranslationUnit> asts;
private final boolean cpp;
public SinglePDOMTestNamedFilesStrategy(boolean cpp) {
this.cpp = cpp;
astSources = new ArrayList<StringBuilder>();
asts = new ArrayList<IASTTranslationUnit>();
}
public ICProject getCProject() {
return cproject;
}
public StringBuilder[] getTestData() {
return testData;
}
public int getAstCount() {
return asts.size();
}
public IASTTranslationUnit getAst(int index) {
return asts.get(index);
}
public StringBuilder getAstSource(int index) {
return astSources.get(index);
}
public void setUp() throws Exception {
cproject = cpp ? CProjectHelper.createCCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER)
: CProjectHelper.createCProject(getName() + System.currentTimeMillis(), "bin", IPDOMManager.ID_NO_INDEXER);
Bundle b = CTestPlugin.getDefault().getBundle();
testData = TestSourceReader.getContentsForTest(b, "parser", IndexBindingResolutionTestBase.this.getClass(), getName(), 0);
List<IFile> astFiles = new ArrayList<IFile>();
for (int i = 0; i < testData.length; i++) {
StringBuilder contents = testData[i];
int endOfLine = contents.indexOf("\n");
if (endOfLine >= 0)
endOfLine++;
else
endOfLine = contents.length();
String filename = contents.substring(0, endOfLine).trim();
contents.delete(0, endOfLine); // Remove first line from the file contents
boolean astRequested = filename.endsWith("*");
if (astRequested) {
filename = filename.substring(0, filename.length() - 1).trim();
}
IFile file = TestSourceReader.createFile(cproject.getProject(), new Path(filename), contents.toString());
if (astRequested || (i == testData.length - 1 && astFiles.isEmpty())) {
astSources.add(contents);
astFiles.add(file);
}
}
CCorePlugin.getIndexManager().setIndexerId(cproject, IPDOMManager.ID_FAST_INDEXER);
assertTrue(CCorePlugin.getIndexManager().joinIndexer(360000, new NullProgressMonitor()));
if (DEBUG) {
System.out.println("Project PDOM: "+getName());
((PDOM) CCoreInternals.getPDOMManager().getPDOM(cproject)).accept(new PDOMPrettyPrinter());
}
index= CCorePlugin.getIndexManager().getIndex(cproject);
index.acquireReadLock();
for (IFile file : astFiles) {
asts.add(TestSourceReader.createIndexBasedAST(index, cproject, file));
}
}
public void tearDown() throws Exception {
if (index != null) {
index.releaseReadLock();
}
if (cproject != null) {
cproject.getProject().delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, new NullProgressMonitor());
}
}
public IIndex getIndex() {
return index;
}
public boolean isCompositeIndex() {
return false;
}
}
class ReferencedProject implements ITestStrategy {
private IIndex index;
private ICProject cproject, referenced;
@ -445,10 +580,22 @@ public abstract class IndexBindingResolutionTestBase extends BaseTestCase {
return referenced;
}
public IASTTranslationUnit getAst() {
public int getAstCount() {
return 1;
}
public IASTTranslationUnit getAst(int index) {
if (index != 0)
throw new IllegalArgumentException();
return ast;
}
public StringBuilder getAstSource(int index) {
if (index != 0)
throw new IllegalArgumentException();
return testData[1];
}
public IIndex getIndex() {
return index;
}

View file

@ -289,6 +289,17 @@ public class IndexBugsTests extends BaseTestCase {
return TestSourceReader.createFile(container, new Path(fileName), contents);
}
private IIndexFile getIndexFile(IFile file) throws CoreException {
return getIndexFile(fIndex, file);
}
private IIndexFile getIndexFile(IIndex index, IFile file) throws CoreException {
IIndexFile[] files = index.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertTrue("Can't find " + file.getLocation(), files.length > 0);
assertEquals("Found " + files.length + " files for " + file.getLocation() + " instead of one", 1, files.length);
return files[0];
}
private void waitForIndexer() throws InterruptedException {
final IIndexManager indexManager = CCorePlugin.getIndexManager();
assertTrue(indexManager.joinIndexer(INDEX_WAIT_TIME, npm()));
@ -459,8 +470,7 @@ public class IndexBugsTests extends BaseTestCase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
IIndexInclude i= includes[0];
@ -484,8 +494,7 @@ public class IndexBugsTests extends BaseTestCase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
IIndexInclude i= includes[0];
@ -561,8 +570,7 @@ public class IndexBugsTests extends BaseTestCase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
IIndexInclude i= includes[0];
@ -585,8 +593,7 @@ public class IndexBugsTests extends BaseTestCase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
IIndexInclude i= includes[0];
@ -612,8 +619,7 @@ public class IndexBugsTests extends BaseTestCase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexMacro[] macros= ifile.getMacros();
assertEquals(3, macros.length);
IIndexMacro m= macros[0];
@ -1116,7 +1122,7 @@ public class IndexBugsTests extends BaseTestCase {
// #endif
// #ifndef _h1
// #include "header1.h"
// #include "header1.h" // is inactive, but must be resolved
// #endif
// #include "header1.h"
@ -1127,7 +1133,7 @@ public class IndexBugsTests extends BaseTestCase {
// #include "header2.h"
// #ifndef _h1
// #include "header1.h"
// #include "header1.h" // inactive but resolved.
// #endif
public void testIncludeGuardsOutsideOfHeader_Bug167100() throws Exception {
final IIndexManager indexManager = CCorePlugin.getIndexManager();
@ -1152,13 +1158,15 @@ public class IndexBugsTests extends BaseTestCase {
assertEquals(1, names.length);
assertEquals(f4.getFullPath().toString(), names[0].getFile().getLocation().getFullPath());
IIndexFile idxFile= index.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f5));
IIndexFile[] idxFiles= index.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f5));
assertEquals(1, idxFiles.length);
IIndexFile idxFile= idxFiles[0];
IIndexInclude[] includes= idxFile.getIncludes();
assertEquals(2, includes.length);
assertTrue(includes[0].isActive());
assertTrue(includes[0].isResolved());
assertFalse(includes[1].isActive());
assertTrue(includes[1].isResolved());
// includes[1].isResolved()); May or may not be resolved.
} finally {
index.releaseReadLock();
}
@ -1658,11 +1666,11 @@ public class IndexBugsTests extends BaseTestCase {
waitForIndexer();
fIndex.acquireReadLock();
try {
IIndexFile f= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f1));
IIndexFile f= getIndexFile(f1);
IIndexInclude i= f.getIncludes()[0];
assertTrue(i.isResolvedByHeuristics());
f= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f2));
f= getIndexFile(f2);
i= f.getIncludes()[0];
assertFalse(i.isResolvedByHeuristics());
} finally {
@ -1683,7 +1691,7 @@ public class IndexBugsTests extends BaseTestCase {
waitForIndexer();
fIndex.acquireReadLock();
try {
IIndexFile f= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f1));
IIndexFile f= getIndexFile(f1);
IIndexInclude[] is= f.getIncludes();
assertFalse(is[0].isResolved());
assertTrue(is[1].isResolvedByHeuristics());
@ -1702,12 +1710,12 @@ public class IndexBugsTests extends BaseTestCase {
// int aOK;
// #endif /* A_H_ */
// #ifndef B_H_
// #define B_H_
// #ifndef A_H_
// #include "a.h"
// #endif
//
// #ifndef B_H_
// #define B_H_
// int bOK;
// #endif
@ -2125,7 +2133,7 @@ public class IndexBugsTests extends BaseTestCase {
IIndex index= indexManager.getIndex(fCProject);
index.acquireReadLock();
try {
IIndexFile file= index.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f));
IIndexFile file= getIndexFile(index, f);
// check order of includes
IIndexInclude[] incs = file.getIncludes();
assertEquals(2, incs.length);
@ -2157,7 +2165,7 @@ public class IndexBugsTests extends BaseTestCase {
IIndex index= indexManager.getIndex(fCProject);
index.acquireReadLock();
try {
IIndexFile file= index.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(f));
IIndexFile file= getIndexFile(index, f);
int idx= testData.indexOf("f(");
IIndexName[] names = file.findNames(idx, idx+1);
assertEquals(1, names.length);
@ -2423,4 +2431,4 @@ public class IndexBugsTests extends BaseTestCase {
index.releaseReadLock();
}
}
}
}

View file

@ -35,6 +35,7 @@ import org.eclipse.cdt.core.testplugin.CProjectHelper;
import org.eclipse.cdt.core.testplugin.CTestPlugin;
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;
@ -458,9 +459,10 @@ class ProjectBuilder {
CProjectHelper.createCCProject(name, "bin", IPDOMManager.ID_NO_INDEXER) :
CProjectHelper.createCCProject(name, "bin", IPDOMManager.ID_NO_INDEXER);
IFile lastFile= null;
for (Iterator i = path2content.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
TestSourceReader.createFile(result.getProject(), new Path((String)entry.getKey()), (String) entry.getValue());
lastFile= TestSourceReader.createFile(result.getProject(), new Path((String)entry.getKey()), (String) entry.getValue());
}
IProjectDescription desc = result.getProject().getDescription();
@ -468,6 +470,10 @@ class ProjectBuilder {
result.getProject().setDescription(desc, new NullProgressMonitor());
CCorePlugin.getIndexManager().setIndexerId(result, IPDOMManager.ID_FAST_INDEXER);
if (lastFile != null) {
IIndex index= CCorePlugin.getIndexManager().getIndex(result);
TestSourceReader.waitUntilFileIsIndexed(index, lastFile, 2000);
}
BaseTestCase.waitForIndexer(result);
return result;
}

View file

@ -7,6 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
*******************************************************************************/
package org.eclipse.cdt.internal.index.tests;
@ -64,6 +65,7 @@ public class IndexIncludeTest extends IndexTestBase {
CoreModel.newIncludeEntry(fProject.getPath(), null,
fProject.getResource().getLocation()) };
fProject.setRawPathEntries(entries, npm());
IndexerPreferences.set(fProject.getProject(), IndexerPreferences.KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, "false");
}
fIndex= CCorePlugin.getIndexManager().getIndex(fProject);
}
@ -114,17 +116,16 @@ public class IndexIncludeTest extends IndexTestBase {
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
file.setContents(new ByteArrayInputStream( "int included; int CONTEXT;\n".getBytes()), false, false, npm());
file.setLocalTimeStamp(timestamp+1000);
file.setContents(new ByteArrayInputStream("int included; int CONTEXT;\n".getBytes()), false, false, npm());
file.setLocalTimeStamp(timestamp + 1000);
}
}, npm());
assertTrue("Timestamp was not increased", file.getLocalTimeStamp() >= timestamp);
TestSourceReader.waitUntilFileIsIndexed(fIndex, file, 4000);
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull("Can't find " + file.getLocation(), ifile);
assertTrue("timestamp not ok", ifile.getTimestamp() >= timestamp);
IIndexFile ifile= getIndexFile(file);
assertTrue("Timestamp not ok", ifile.getTimestamp() >= timestamp);
IIndexBinding[] result= fIndex.findBindings(Pattern.compile("testInclude_cpp"), true, IndexFilter.ALL, npm());
assertEquals(1, result.length);
@ -134,6 +135,13 @@ public class IndexIncludeTest extends IndexTestBase {
} finally {
fIndex.releaseReadLock();
}
}
private IIndexFile getIndexFile(IFile file) throws CoreException {
IIndexFile[] files = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertTrue("Can't find " + file.getLocation(), files.length > 0);
assertEquals("Found " + files.length + " files for " + file.getLocation() + " instead of one", 1, files.length);
return files[0];
}
// {source20061107}
@ -150,8 +158,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(2, includes.length);
@ -174,8 +181,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
@ -194,8 +200,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
@ -215,8 +220,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(file));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(file);
IIndexInclude[] includes= ifile.getIncludes();
assertEquals(1, includes.length);
@ -238,7 +242,10 @@ public class IndexIncludeTest extends IndexTestBase {
public void testUpdateOfIncluded() throws Exception {
String content1 = "int CONTEXT_20070404(x);\n";
String content2 = "int CONTEXT_20070404(y);\n";
String content3 = "#define CONTEXT_20070404(x) ctx_20070404##x\n #include \"included_20070404.h\"\n int source_20070404;\n";
String content3 =
"#define CONTEXT_20070404(x) ctx_20070404##x\n" +
"#include \"included_20070404.h\"\n" +
"int source_20070404;\n";
TestSourceReader.createFile(fProject.getProject(), "included_20070404.h", content1);
TestSourceReader.createFile(fProject.getProject(), "notIncluded_20070404.h", "int notIncluded_20070404\n;");
TestSourceReader.createFile(fProject.getProject(), "includer_20070404.cpp", content3);
@ -332,8 +339,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(2, includes.length);
@ -352,8 +358,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
assertEquals(1, fIndex.findBindings("a20070426".toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(2, includes.length);
assertEquals(s1.getFullPath().toString(), includes[0].getIncludedByLocation().getFullPath());
@ -370,8 +375,7 @@ public class IndexIncludeTest extends IndexTestBase {
fIndex.acquireReadLock();
try {
assertEquals(1, fIndex.findBindings("b20070426".toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(2, includes.length);
assertEquals(s1.getFullPath().toString(), includes[0].getIncludedByLocation().getFullPath());
@ -448,14 +452,188 @@ public class IndexIncludeTest extends IndexTestBase {
standardCheckUpdateIncludes(header, s1, "h20070427");
}
// #ifdef A
// static const int a = 0;
// #endif
// #ifdef B
// static const int b = 0;
// #endif
// #ifdef C
// static const int c = 0;
// #endif
// #define A
// #include "h1.h"
// #undef A
// #define B
// #include "h1.h"
// #undef B
// #define C
// #include "h1.h"
// #include "h2.h"
public void testMultiVariantHeaderUpdate() throws Exception {
waitForIndexer();
TestScannerProvider.sIncludes= new String[] { fProject.getProject().getLocation().toOSString() };
StringBuilder[] contents= getContentsForTest(4);
final StringBuilder h1Contents = contents[0];
final IFile h1= TestSourceReader.createFile(fProject.getProject(), "h1.h", h1Contents.toString());
IFile h2= TestSourceReader.createFile(fProject.getProject(), "h2.h", contents[1].toString());
IFile s1= TestSourceReader.createFile(fProject.getProject(), "s1.cpp", contents[2].toString());
IFile s2= TestSourceReader.createFile(fProject.getProject(), "s2.cpp", contents[3].toString());
TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_WAIT_TIME);
fIndex.acquireReadLock();
try {
IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1));
assertEquals(3, indexFiles.length);
} finally {
fIndex.releaseReadLock();
}
final long timestamp= System.currentTimeMillis();
while (true) {
int pos = h1Contents.indexOf("int");
if (pos < 0)
break;
h1Contents.replace(pos, pos + "int".length(), "float");
}
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
h1.setContents(new ByteArrayInputStream(h1Contents.toString().getBytes()), false, false, npm());
h1.setLocalTimeStamp(timestamp + 1000);
}
}, npm());
waitForIndexer();
fIndex.acquireReadLock();
try {
IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1));
assertEquals(3, indexFiles.length);
for (IIndexFile indexFile : indexFiles) {
assertTrue("Timestamp not ok", indexFile.getTimestamp() >= timestamp);
}
} finally {
fIndex.releaseReadLock();
}
}
// #ifdef A
// static const int a = 0;
// #endif
// #ifdef B
// static const int b = 0;
// #endif
// #ifdef C
// static const int c = 0;
// #endif
// #define A
// #include "h1.h"
// #undef A
// #define B
// #include "h1.h"
// #undef B
// #define C
// #include "h1.h"
// #include "h2.h"
// #ifndef H1_H_
// #define H1_H_
// #ifdef A
// static const int a = 0;
// #endif
// #ifdef B
// static const int b = 0;
// #endif
// #ifdef C
// static const int c = 0;
// #endif
// #endif // H1_H_
public void testPragmaOnceChange() throws Exception {
waitForIndexer();
TestScannerProvider.sIncludes= new String[] { fProject.getProject().getLocation().toOSString() };
CharSequence[] contents= getContentsForTest(5);
final CharSequence h1Contents = contents[0];
final IFile h1= TestSourceReader.createFile(fProject.getProject(), "h1.h", h1Contents.toString());
IFile h2= TestSourceReader.createFile(fProject.getProject(), "h2.h", contents[1].toString());
IFile s1= TestSourceReader.createFile(fProject.getProject(), "s1.cpp", contents[2].toString());
IFile s2= TestSourceReader.createFile(fProject.getProject(), "s2.cpp", contents[3].toString());
TestSourceReader.waitUntilFileIsIndexed(fIndex, s1, INDEXER_WAIT_TIME);
TestSourceReader.waitUntilFileIsIndexed(fIndex, s2, INDEXER_WAIT_TIME);
fIndex.acquireReadLock();
try {
IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1));
assertEquals(3, indexFiles.length);
for (IIndexFile indexFile : indexFiles) {
assertFalse(indexFile.hasPragmaOnceSemantics());
assertEquals(1, fIndex.findIncludedBy(indexFile).length);
}
} finally {
fIndex.releaseReadLock();
}
// Change h1.h so that it has the pragma-once semantics.
final long t1= System.currentTimeMillis();
final String changedContents = contents[4].toString();
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
h1.setContents(new ByteArrayInputStream(changedContents.getBytes()), false, false, npm());
h1.setLocalTimeStamp(t1 + 1000);
}
}, npm());
waitForIndexer();
fIndex.acquireReadLock();
try {
IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1));
assertEquals(1, indexFiles.length);
for (IIndexFile indexFile : indexFiles) {
assertTrue("Timestamp not ok", indexFile.getTimestamp() >= t1);
assertTrue(indexFile.hasPragmaOnceSemantics());
// Included twice by h2.h and once by s1.cpp
assertEquals(2, fIndex.findIncludedBy(indexFile).length);
}
} finally {
fIndex.releaseReadLock();
}
// Change h1.h back to the original state without the pragma-once semantics.
final long t2= System.currentTimeMillis();
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
h1.setContents(new ByteArrayInputStream(h1Contents.toString().getBytes()), false, false, npm());
h1.setLocalTimeStamp(t2 + 2000);
}
}, npm());
waitForIndexer();
fIndex.acquireReadLock();
try {
IIndexFile[] indexFiles = fIndex.getFiles(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(h1));
assertEquals(3, indexFiles.length);
for (IIndexFile indexFile : indexFiles) {
assertTrue("Timestamp not ok", indexFile.getTimestamp() >= t2);
assertFalse(indexFile.hasPragmaOnceSemantics());
assertEquals(1, fIndex.findIncludedBy(indexFile).length);
}
} finally {
fIndex.releaseReadLock();
}
}
private void standardCheckUpdateIncludes(IFile header, IFile s1, String tag) throws Exception {
fIndex.acquireReadLock();
try {
assertEquals(1, fIndex.findBindings(tag.toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
IIndexFile sfile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(s1));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexFile sfile= getIndexFile(s1);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(1, includes.length);
assertEquals(s1.getFullPath().toString(), includes[0].getIncludedByLocation().getFullPath());
@ -464,7 +642,6 @@ public class IndexIncludeTest extends IndexTestBase {
assertTrue(includes[0].isResolved());
assertFalse(includes[0].isSystemInclude());
assertNotNull(sfile);
includes= fIndex.findIncludes(sfile);
assertEquals(3, includes.length);
assertEquals(header.getFullPath().toString(), includes[0].getIncludesLocation().getFullPath());
@ -494,13 +671,11 @@ public class IndexIncludeTest extends IndexTestBase {
try {
assertEquals(1, fIndex.findBindings(tag.toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
IIndexFile sfile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(s1));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexFile sfile= getIndexFile(s1);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(0, includes.length);
assertNotNull(sfile);
includes= fIndex.findIncludes(sfile);
assertEquals(2, includes.length);
@ -525,9 +700,8 @@ public class IndexIncludeTest extends IndexTestBase {
try {
assertEquals(1, fIndex.findBindings(tag.toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
IIndexFile sfile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(s1));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexFile sfile= getIndexFile(s1);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(1, includes.length);
assertEquals(s1.getFullPath().toString(), includes[0].getIncludedByLocation().getFullPath());
@ -536,7 +710,6 @@ public class IndexIncludeTest extends IndexTestBase {
assertTrue(includes[0].isResolved());
assertTrue(includes[0].isSystemInclude());
assertNotNull(sfile);
includes= fIndex.findIncludes(sfile);
assertEquals(2, includes.length);
assertEquals(header.getFullPath().toString(), includes[0].getIncludesLocation().getFullPath());
@ -560,9 +733,8 @@ public class IndexIncludeTest extends IndexTestBase {
try {
assertEquals(1, fIndex.findBindings(tag.toCharArray(), IndexFilter.ALL_DECLARED, npm()).length);
IIndexFile ifile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(header));
IIndexFile sfile= fIndex.getFile(ILinkage.CPP_LINKAGE_ID, IndexLocationFactory.getWorkspaceIFL(s1));
assertNotNull(ifile);
IIndexFile ifile= getIndexFile(header);
IIndexFile sfile= getIndexFile(s1);
IIndexInclude[] includes= fIndex.findIncludedBy(ifile);
assertEquals(1, includes.length);
assertEquals(s1.getFullPath().toString(), includes[0].getIncludedByLocation().getFullPath());
@ -571,7 +743,6 @@ public class IndexIncludeTest extends IndexTestBase {
assertTrue(includes[0].isResolved());
assertFalse(includes[0].isSystemInclude());
assertNotNull(sfile);
includes= fIndex.findIncludes(sfile);
assertEquals(2, includes.length);
assertEquals(header.getFullPath().toString(), includes[0].getIncludesLocation().getFullPath());

View file

@ -101,9 +101,11 @@ public class IndexListenerTest extends BaseTestCase {
assertTrue(im.joinIndexer(10000, npm()));
IIndexChangeListener listener = new IIndexChangeListener() {
public void indexChanged(IIndexChangeEvent event) {
synchronized (mutex) {
projects.add(event.getAffectedProject());
mutex.notify();
if (!event.getFilesWritten().isEmpty()) {
synchronized (mutex) {
projects.add(event.getAffectedProject());
mutex.notify();
}
}
}
};
@ -119,7 +121,6 @@ public class IndexListenerTest extends BaseTestCase {
assertTrue(projects.contains(fProject1));
projects.clear();
IFile file1= TestSourceReader.createFile(fProject1.getProject(), "test.cpp", "int b;");
IFile file2= TestSourceReader.createFile(fProject2.getProject(), "test.cpp", "int c;");
synchronized (mutex) {

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