mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Add test for InputType, assignToOption attribute
This commit is contained in:
parent
397635f067
commit
632b56175a
4 changed files with 172 additions and 1 deletions
|
@ -4610,5 +4610,110 @@
|
|||
|
||||
<!-- Executable project type end -->
|
||||
|
||||
<!-- Project type for testing assignToOption -->
|
||||
|
||||
<projectType
|
||||
id="cdt.test.assignToOption.executableProjectType"
|
||||
isAbstract="false"
|
||||
isTest="true"
|
||||
name="AssignToOption Executable">
|
||||
<configuration
|
||||
artifactExtension="out"
|
||||
cleanCommand="rm -rf"
|
||||
id="cdt.test.assignToOption.debug"
|
||||
name="Debug">
|
||||
<toolChain
|
||||
id="cdt.test.assignToOption.exeDebugToolchain"
|
||||
isAbstract="false"
|
||||
name="AssingToOption Tools"
|
||||
targetTool="cdt.test.assignToOption.exeLinkerDebug">
|
||||
<tool
|
||||
id="cdt.test.assignToOption.compilerDebug"
|
||||
isAbstract="false"
|
||||
name="AssignToOption Compiler"
|
||||
superClass="cdt.test.assignToOption.compiler"/>
|
||||
<tool
|
||||
id="cdt.test.assignToOption.exeLinkerDebug"
|
||||
isAbstract="false"
|
||||
name="AssignToOption Executable Linker"
|
||||
superClass="cdt.test.assignToOption.exeLinker"/>
|
||||
</toolChain>
|
||||
</configuration>
|
||||
</projectType>
|
||||
<tool
|
||||
command="ATOC"
|
||||
id="cdt.test.assignToOption.compiler"
|
||||
isAbstract="false"
|
||||
name="AssignToOption Compiler"
|
||||
natureFilter="both">
|
||||
<inputType
|
||||
id="cdt.test.assignToOption.compilerSources"
|
||||
multipleOfType="false"
|
||||
name="ATOC Sources"
|
||||
primaryInput="true"
|
||||
sources="c,C,cpp,CPP"/>
|
||||
<inputType
|
||||
id="cdt.test.assignToOption.compilerSecondary"
|
||||
name="Compiler Option Files"
|
||||
assignToOption="cdt.test.assignToOption.compilerFileOption"
|
||||
sources="cop"/>
|
||||
<outputType
|
||||
buildVariable="OBJS"
|
||||
id="cdt.test.assignToOption.compilerObjectFilesTypeOutput"
|
||||
multipleOfType="false"
|
||||
name="Object Files"
|
||||
outputs="obj"
|
||||
primaryInputType="cdt.test.assignToOption.compilerSources"
|
||||
primaryOutput="true"/>
|
||||
<option
|
||||
command="-opt"
|
||||
id="cdt.test.assignToOption.compilerFileOption"
|
||||
isAbstract="false"
|
||||
name="Compiler Option File"
|
||||
applicabilityCalculator="org.eclipse.cdt.managedbuilder.core.tests.CmdLineApplicabilityCalculator"
|
||||
valueType="string"/>
|
||||
</tool>
|
||||
<tool
|
||||
command="ATOL"
|
||||
id="cdt.test.assignToOption.exeLinker"
|
||||
isAbstract="false"
|
||||
name="AssignToOption Executable Linker"
|
||||
natureFilter="both"
|
||||
outputFlag="-o">
|
||||
<inputType
|
||||
buildVariable="OBJS"
|
||||
id="cdt.test.assignToOption.compilerObjectFilesTypeInput"
|
||||
multipleOfType="true"
|
||||
name="Object Files"
|
||||
primaryInput="true"
|
||||
sources="obj"/>
|
||||
<inputType
|
||||
id="cdt.test.assignToOption.linkerFileInputType"
|
||||
multipleOfType="true"
|
||||
name="Linker Option Files"
|
||||
assignToOption="cdt.test.assignToOption.linkerFileOption"
|
||||
primaryInput="false"
|
||||
sources="opt"/>
|
||||
<outputType
|
||||
id="cdt.test.assignToOption.exeOutputType"
|
||||
name="AssignToOption Executable"
|
||||
outputs="out"
|
||||
primaryInputType="cdt.test.assignToOption.compilerObjectFilesTypeInput"
|
||||
primaryOutput="true"/>
|
||||
<option
|
||||
browseType="file"
|
||||
category="cdt.test.assignToOption.optionCategory1"
|
||||
command="-opt"
|
||||
id="cdt.test.assignToOption.linkerFileOption"
|
||||
isAbstract="false"
|
||||
name="Linker Option File"
|
||||
resourceFilter="project"
|
||||
valueType="stringList"/>
|
||||
<optionCategory
|
||||
id="cdt.test.assignToOption.optionCategory1"
|
||||
name="Linker Options"
|
||||
owner="cdt.test.assignToOption.exeLinker"/>
|
||||
</tool>
|
||||
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,53 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 Texas Instruments Inc. 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:
|
||||
* Texas Instruments Inc. - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOptionApplicability;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class CmdLineApplicabilityCalculator implements IOptionApplicability {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionUsedInCommandLine()
|
||||
*/
|
||||
public boolean isOptionUsedInCommandLine(
|
||||
IBuildObject config,
|
||||
IHoldsOptions holder,
|
||||
IOption option) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionVisible()
|
||||
*/
|
||||
public boolean isOptionVisible(
|
||||
IBuildObject config,
|
||||
IHoldsOptions holder,
|
||||
IOption option) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOptionApplicability#isOptionEnabled()
|
||||
*/
|
||||
public boolean isOptionEnabled(
|
||||
IBuildObject config,
|
||||
IHoldsOptions holder,
|
||||
IOption option) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -33,7 +33,6 @@ import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
|||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
|
||||
import org.eclipse.cdt.managedbuilder.projectconverter.UpdateManagedProjectManager;
|
||||
|
@ -79,6 +78,7 @@ public class ManagedProject30MakefileTests extends TestCase {
|
|||
suite.addTest(new ManagedProject30MakefileTests("testTopTC"));
|
||||
suite.addTest(new ManagedProject30MakefileTests("CDTFortranTest1"));
|
||||
suite.addTest(new ManagedProject30MakefileTests("CDTFortranTest2"));
|
||||
suite.addTest(new ManagedProject30MakefileTests("TestATO"));
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
@ -571,4 +571,17 @@ public class ManagedProject30MakefileTests extends TestCase {
|
|||
IProject[] projects = createProjects("CDTFortranTest2", null, null, true);
|
||||
buildProjects(projects, makefiles);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* tests the InputType assignToOption attribute
|
||||
*/
|
||||
public void TestATO(){
|
||||
IPath[] makefiles = {
|
||||
Path.fromOSString("makefile"),
|
||||
Path.fromOSString("objects.mk"),
|
||||
Path.fromOSString("sources.mk"),
|
||||
Path.fromOSString("subdir.mk")};
|
||||
IProject[] projects = createProjects("TestATO", null, null, true);
|
||||
buildProjects(projects, makefiles);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue