summaryrefslogtreecommitdiffstats
path: root/src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java
diff options
context:
space:
mode:
authordarius42 <[email protected]>2007-09-21 17:57:00 +0000
committerdarius42 <[email protected]>2007-09-21 17:57:00 +0000
commit669990903206d83b4f2c11974cc29dce576a5789 (patch)
tree7386878e21a208ec5f1633d15fa94cd2d46ca213 /src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java
parent91b61f8842a491f1bf9cb6d59f648b6eb5f16190 (diff)
Fix for bug 1794867 - LinkerDef wasn't correctly handling references.
Refactored code so that it relies on the correct behavior in ProcessorDef. git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@145 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java')
-rw-r--r--src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java b/src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java
index 9387d5b..994b068 100644
--- a/src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java
+++ b/src/test/java/net/sf/antcontrib/cpptasks/TestLinkerDef.java
@@ -26,8 +26,10 @@ import net.sf.antcontrib.cpptasks.types.FlexLong;
import net.sf.antcontrib.cpptasks.types.LibrarySet;
import net.sf.antcontrib.cpptasks.types.LinkerArgument;
import net.sf.antcontrib.cpptasks.types.SystemLibrarySet;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.FlexInteger;
+import org.apache.tools.ant.types.Reference;
/**
* Tests for LinkerDef class.
@@ -152,6 +154,35 @@ public final class TestLinkerDef
}
/**
+ * Verify linkerarg's that appear in the base linker are effective when
+ * creating the command line for a linker that extends it, even if the
+ * linker is brought in through a reference.
+ */
+ public void testExtendsLinkerArgsViaReference() {
+ Project project = new Project();
+ LinkerDef baseLinker = new LinkerDef();
+ baseLinker.setProject(project);
+ baseLinker.setId("base");
+ project.addReference("base", baseLinker);
+ LinkerArgument linkerArg = new LinkerArgument();
+ linkerArg.setValue("/base");
+ baseLinker.addConfiguredLinkerArg(linkerArg);
+
+ LinkerDef extendedLinker = (LinkerDef) createExtendedProcessorDef(
+ baseLinker);
+ extendedLinker.setProject(project);
+ extendedLinker.setId("extended");
+ project.addReference("extended", extendedLinker);
+
+ LinkerDef linkerRef = new LinkerDef();
+ linkerRef.setProject(project);
+ linkerRef.setRefid(new Reference(project, "extended"));
+ String[] preArgs = getPreArguments(linkerRef);
+ assertEquals(1, preArgs.length);
+ assertEquals("/base", preArgs[0]);
+ }
+
+ /**
* Tests that fileset's that appear in the base linker are effective when
* creating the command line for a linker that extends it.
* @throws IOException if unable to create or delete temporary file