mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Update test directory name to match package name.
Modify test30_2
This commit is contained in:
parent
ca05599a27
commit
dd9f50418f
16 changed files with 165 additions and 26 deletions
|
@ -325,7 +325,7 @@
|
||||||
</target>
|
</target>
|
||||||
<dynamicElementProvider
|
<dynamicElementProvider
|
||||||
name="Test Target Provider"
|
name="Test Target Provider"
|
||||||
class="org.eclipse.cdt.managedbuild.core.tests.TestManagedConfigProvider">
|
class="org.eclipse.cdt.managedbuilder.core.tests.TestManagedConfigProvider">
|
||||||
</dynamicElementProvider>
|
</dynamicElementProvider>
|
||||||
<target
|
<target
|
||||||
isTest="true"
|
isTest="true"
|
||||||
|
@ -1674,7 +1674,7 @@
|
||||||
<tool
|
<tool
|
||||||
id="cdt.managedbuild.test.java.attrs.tool"
|
id="cdt.managedbuild.test.java.attrs.tool"
|
||||||
superClass="cdt.managedbuild.tool.testgnu.c.compiler"
|
superClass="cdt.managedbuild.tool.testgnu.c.compiler"
|
||||||
commandLineGenerator="org.eclipse.cdt.managedbuild.core.tests.ManagedBuildCommandLineGenerator">
|
commandLineGenerator="org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCommandLineGenerator">
|
||||||
<option
|
<option
|
||||||
id="testgnu.c.compiler.option.preprocessor.def.symbols.test"
|
id="testgnu.c.compiler.option.preprocessor.def.symbols.test"
|
||||||
superClass="testgnu.c.compiler.option.preprocessor.def.symbols">
|
superClass="testgnu.c.compiler.option.preprocessor.def.symbols">
|
||||||
|
@ -1691,7 +1691,7 @@
|
||||||
name="Test Builder"
|
name="Test Builder"
|
||||||
command="makeMe"
|
command="makeMe"
|
||||||
arguments="-k"
|
arguments="-k"
|
||||||
buildfileGenerator="org.eclipse.cdt.managedbuild.core.tests.BuildFileGenerator">
|
buildfileGenerator="org.eclipse.cdt.managedbuilder.core.tests.BuildFileGenerator">
|
||||||
</builder>
|
</builder>
|
||||||
</toolChain>
|
</toolChain>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -3276,7 +3276,7 @@
|
||||||
|
|
||||||
<!-- Test tools and project types for testing multiple input types,
|
<!-- Test tools and project types for testing multiple input types,
|
||||||
multiple output types, and input & output options
|
multiple output types, and input & output options
|
||||||
tar -cf & tar -tf -->
|
tar -cf, tar -tf, & cat -->
|
||||||
|
|
||||||
<projectType
|
<projectType
|
||||||
isAbstract="false"
|
isAbstract="false"
|
||||||
|
@ -3291,7 +3291,7 @@
|
||||||
errorParsers="">
|
errorParsers="">
|
||||||
<toolChain
|
<toolChain
|
||||||
name="ToolChain for test30_2"
|
name="ToolChain for test30_2"
|
||||||
targetTool="test30_2.tar.list"
|
targetTool="test30_2.cat"
|
||||||
id="test30_2.tar.toolchain">
|
id="test30_2.tar.toolchain">
|
||||||
<builder
|
<builder
|
||||||
id="test30_2.tar.builder"
|
id="test30_2.tar.builder"
|
||||||
|
@ -3345,6 +3345,7 @@
|
||||||
name="tar-list"
|
name="tar-list"
|
||||||
command="tar"
|
command="tar"
|
||||||
commandLinePattern="${COMMAND} ${FLAGS} ${INPUTS} > ${OUTPUT}"
|
commandLinePattern="${COMMAND} ${FLAGS} ${INPUTS} > ${OUTPUT}"
|
||||||
|
commandLineGenerator="org.eclipse.cdt.managedbuilder.core.tests.Test30_2_CommandLineGenerator"
|
||||||
id="test30_2.tar-list">
|
id="test30_2.tar-list">
|
||||||
<optionCategory
|
<optionCategory
|
||||||
name="Options"
|
name="Options"
|
||||||
|
@ -3357,6 +3358,13 @@
|
||||||
id="test30_2.tar-list.other"
|
id="test30_2.tar-list.other"
|
||||||
valueType="string">
|
valueType="string">
|
||||||
</option>
|
</option>
|
||||||
|
<option
|
||||||
|
defaultValue="new.log"
|
||||||
|
name="Log File Name"
|
||||||
|
category="test30_2.tar-list.category"
|
||||||
|
id="test30_2.tar-list.filename"
|
||||||
|
valueType="string">
|
||||||
|
</option>
|
||||||
<inputType
|
<inputType
|
||||||
id="test30_2.tar-list.input1"
|
id="test30_2.tar-list.input1"
|
||||||
buildVariable="TAROUT"
|
buildVariable="TAROUT"
|
||||||
|
@ -3365,7 +3373,25 @@
|
||||||
<outputType
|
<outputType
|
||||||
id="test30_2.tar-list.outputlog"
|
id="test30_2.tar-list.outputlog"
|
||||||
name="Log file"
|
name="Log file"
|
||||||
outputs="log">
|
outputs="log"
|
||||||
|
buildVariable="LOGFILE"
|
||||||
|
option="test30_2.tar-list.filename">
|
||||||
|
</outputType>
|
||||||
|
</tool>
|
||||||
|
<tool
|
||||||
|
name="cat"
|
||||||
|
command="cat"
|
||||||
|
commandLinePattern="${COMMAND} ${INPUTS}"
|
||||||
|
id="test30_2.cat">
|
||||||
|
<inputType
|
||||||
|
id="test30_2.cat.input"
|
||||||
|
buildVariable="LOGFILE"
|
||||||
|
sources="log">
|
||||||
|
</inputType>
|
||||||
|
<outputType
|
||||||
|
id="test30_2.cat.output"
|
||||||
|
name="Terminal (dummy output)"
|
||||||
|
outputs="tmp">
|
||||||
</outputType>
|
</outputType>
|
||||||
</tool>
|
</tool>
|
||||||
</toolChain>
|
</toolChain>
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
package org.eclipse.cdt.managedbuilder.tests.suite;
|
package org.eclipse.cdt.managedbuilder.tests.suite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ManagedBuildCoreTests;
|
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCoreTests;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ManagedBuildCoreTests20;
|
import org.eclipse.cdt.managedbuilder.core.tests.ManagedBuildCoreTests20;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ManagedCommandLineGeneratorTest;
|
import org.eclipse.cdt.managedbuilder.core.tests.ManagedCommandLineGeneratorTest;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ManagedProjectUpdateTests;
|
import org.eclipse.cdt.managedbuilder.core.tests.ManagedProject21MakefileTests;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ResourceBuildCoreTests;
|
import org.eclipse.cdt.managedbuilder.core.tests.ManagedProject30MakefileTests;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ManagedProject21MakefileTests;
|
import org.eclipse.cdt.managedbuilder.core.tests.ManagedProjectUpdateTests;
|
||||||
import org.eclipse.cdt.managedbuild.core.tests.ManagedProject30MakefileTests;
|
import org.eclipse.cdt.managedbuilder.core.tests.ResourceBuildCoreTests;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator;
|
import org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
|
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
|
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
|
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* including InputType, OutputType, etc.
|
* including InputType, OutputType, etc.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileFilter;
|
import java.io.FileFilter;
|
|
@ -13,7 +13,7 @@
|
||||||
* These tests are for a 3.0 style tool integration.
|
* These tests are for a 3.0 style tool integration.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileFilter;
|
import java.io.FileFilter;
|
||||||
|
@ -372,7 +372,6 @@ public class ManagedProject30MakefileTests extends TestCase {
|
||||||
*/
|
*/
|
||||||
public void test30_2(){
|
public void test30_2(){
|
||||||
IPath[] makefiles = {
|
IPath[] makefiles = {
|
||||||
Path.fromOSString("new.log"),
|
|
||||||
Path.fromOSString("makefile"),
|
Path.fromOSString("makefile"),
|
||||||
Path.fromOSString("objects.mk"),
|
Path.fromOSString("objects.mk"),
|
||||||
Path.fromOSString("sources.mk"),
|
Path.fromOSString("sources.mk"),
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileFilter;
|
import java.io.FileFilter;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Intel Corporation - Initial API and implementation
|
* Intel Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
|
@ -0,0 +1,114 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2005 Intel Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Intel Corporation - Initial API and implementation
|
||||||
|
**********************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineInfo;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test command line generator
|
||||||
|
*/
|
||||||
|
public class Test30_2_CommandLineGenerator implements
|
||||||
|
IManagedCommandLineGenerator {
|
||||||
|
|
||||||
|
public final String AT = "@"; //$NON-NLS-1$
|
||||||
|
public final String COLON = ":"; //$NON-NLS-1$
|
||||||
|
public final String DOT = "."; //$NON-NLS-1$
|
||||||
|
public final String ECHO = "echo"; //$NON-NLS-1$
|
||||||
|
public final String IN_MACRO = "$<"; //$NON-NLS-1$
|
||||||
|
public final String LINEBREAK = "\\\n"; //$NON-NLS-1$
|
||||||
|
public final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||||
|
public final String OUT_MACRO = "$@"; //$NON-NLS-1$
|
||||||
|
public final String SEPARATOR = "/"; //$NON-NLS-1$
|
||||||
|
public final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
|
||||||
|
public final String TAB = "\t"; //$NON-NLS-1$
|
||||||
|
public final String WHITESPACE = " "; //$NON-NLS-1$
|
||||||
|
public final String WILDCARD = "%"; //$NON-NLS-1$
|
||||||
|
public final String UNDERLINE = "_"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
public final String VAR_FIRST_CHAR = "$"; //$NON-NLS-1$
|
||||||
|
public final char VAR_SECOND_CHAR = '{'; //$NON-NLS-1$
|
||||||
|
public final String VAR_FINAL_CHAR = "}"; //$NON-NLS-1$
|
||||||
|
public final String CLASS_PROPERTY_PREFIX = "get"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
public final String CMD_LINE_PRM_NAME = "COMMAND"; //$NON-NLS-1$
|
||||||
|
public final String FLAGS_PRM_NAME = "FLAGS"; //$NON-NLS-1$
|
||||||
|
public final String OUTPUT_FLAG_PRM_NAME = "OUTPUT_FLAG"; //$NON-NLS-1$
|
||||||
|
public final String OUTPUT_PREFIX_PRM_NAME = "OUTPUT_PREFIX"; //$NON-NLS-1$
|
||||||
|
public final String OUTPUT_PRM_NAME = "OUTPUT"; //$NON-NLS-1$
|
||||||
|
public final String INPUTS_PRM_NAME = "INPUTS"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator#generateCommandLineInfo(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String[], java.lang.String)
|
||||||
|
*/
|
||||||
|
public IManagedCommandLineInfo generateCommandLineInfo(ITool tool,
|
||||||
|
String commandName, String[] flags, String outputFlag,
|
||||||
|
String outputPrefix, String outputName, String[] inputResources,
|
||||||
|
String commandLinePattern) {
|
||||||
|
ManagedBuildCommandLineInfo info = new ManagedBuildCommandLineInfo();
|
||||||
|
// We are only going to change the "flags" to remove the "test30_2.tar-list.filename" option
|
||||||
|
info.commandName = new String(commandName);
|
||||||
|
info.commandOutputFlag = new String(outputFlag);
|
||||||
|
info.commandOutputPrefix = new String(outputPrefix);
|
||||||
|
info.commandOutput = new String(outputName);
|
||||||
|
info.commandLinePattern = new String(commandLinePattern);
|
||||||
|
info.commandInputs = new String();
|
||||||
|
for (int i = 0; i < inputResources.length; i++) {
|
||||||
|
if (i > 0) info.commandInputs += " ";
|
||||||
|
info.commandInputs += inputResources[i];
|
||||||
|
}
|
||||||
|
info.commandFlags = new String();
|
||||||
|
IOption opt = tool.getOptionBySuperClassId("test30_2.tar-list.filename");
|
||||||
|
String optVal = "";
|
||||||
|
try {
|
||||||
|
optVal = opt.getStringValue();
|
||||||
|
} catch (Exception e) {}
|
||||||
|
for (int i = 0; i < flags.length; i++) {
|
||||||
|
if (!(flags[i].equals(optVal))) {
|
||||||
|
if (i > 0) info.commandFlags += " ";
|
||||||
|
info.commandFlags += flags[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Generate the command line
|
||||||
|
int start = 0;
|
||||||
|
int stop = 0;
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
while( (start = commandLinePattern.indexOf( VAR_FIRST_CHAR, start )) >= 0 ) {
|
||||||
|
if( commandLinePattern.charAt( start + 1 ) != VAR_SECOND_CHAR ) {
|
||||||
|
sb.append(VAR_FIRST_CHAR);
|
||||||
|
start++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if( start > stop ) {
|
||||||
|
sb.append( commandLinePattern.substring(stop, start) );
|
||||||
|
}
|
||||||
|
stop = commandLinePattern.indexOf( VAR_FINAL_CHAR, start + 1 );
|
||||||
|
if( stop > 0 && stop <= commandLinePattern.length() ) try {
|
||||||
|
String varName = commandLinePattern.substring( start+2, stop ).trim();
|
||||||
|
if( varName.compareToIgnoreCase( CMD_LINE_PRM_NAME ) == 0 ) sb.append( info.commandName.trim() );
|
||||||
|
else if( varName.compareToIgnoreCase( FLAGS_PRM_NAME ) == 0 ) sb.append( info.commandFlags );
|
||||||
|
else if( varName.compareToIgnoreCase( OUTPUT_FLAG_PRM_NAME ) == 0 ) sb.append( info.commandOutputFlag.trim() );
|
||||||
|
else if( varName.compareToIgnoreCase( OUTPUT_PREFIX_PRM_NAME ) == 0 ) sb.append( info.commandOutputPrefix.trim() );
|
||||||
|
else if( varName.compareToIgnoreCase( OUTPUT_PRM_NAME ) == 0 ) sb.append( info.commandOutput.trim() );
|
||||||
|
else if( varName.compareToIgnoreCase( INPUTS_PRM_NAME ) == 0 ) sb.append( info.commandInputs );
|
||||||
|
else sb.append( VAR_FIRST_CHAR + VAR_SECOND_CHAR + varName + VAR_FINAL_CHAR );
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
// do nothing for a while
|
||||||
|
}
|
||||||
|
start = ++stop;
|
||||||
|
}
|
||||||
|
info.commandLine = sb.toString();
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* TimeSys Corporation - Initial API and implementation
|
* TimeSys Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* TimeSys Corporation - Initial API and implementation
|
* TimeSys Corporation - Initial API and implementation
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.managedbuild.core.tests;
|
package org.eclipse.cdt.managedbuilder.core.tests;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
Loading…
Add table
Reference in a new issue