summaryrefslogtreecommitdiff
path: root/test/junit/net/sf/antcontrib/cpptasks/compiler
diff options
context:
space:
mode:
authorMark Donszelmann <Mark.Donszelmann@gmail.com>2007-07-05 21:41:16 +0000
committerMark Donszelmann <Mark.Donszelmann@gmail.com>2007-07-05 21:41:16 +0000
commitb03f055da64b4bc24b0ccfc5a439827131016226 (patch)
treec2753cc1a2f25d6f2893ed6f7da36165ef85460a /test/junit/net/sf/antcontrib/cpptasks/compiler
parenta2085fd18c52730d5d85027b77cb4504d06f83c5 (diff)
downloadcpptasks-parallel-b03f055da64b4bc24b0ccfc5a439827131016226.tar.gz
cpptasks-parallel-b03f055da64b4bc24b0ccfc5a439827131016226.tar.bz2
cpptasks-parallel-b03f055da64b4bc24b0ccfc5a439827131016226.tar.xz
cpptasks-parallel-b03f055da64b4bc24b0ccfc5a439827131016226.zip
Updated extra files
Diffstat (limited to 'test/junit/net/sf/antcontrib/cpptasks/compiler')
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Entries7
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Repository1
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Root1
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractCompiler.java85
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractLinker.java89
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractProcessor.java80
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/TestCommandLineCompilerConfiguration.java59
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/TestCompilerConfiguration.java68
-rw-r--r--test/junit/net/sf/antcontrib/cpptasks/compiler/TestLinkType.java59
9 files changed, 0 insertions, 449 deletions
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Entries b/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Entries
deleted file mode 100644
index 2ea4222..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Entries
+++ /dev/null
@@ -1,7 +0,0 @@
-/TestAbstractCompiler.java/1.21/Tue May 11 03:50:12 2004//
-/TestAbstractLinker.java/1.20/Tue May 11 03:50:13 2004//
-/TestAbstractProcessor.java/1.17/Tue May 11 03:50:12 2004//
-/TestCommandLineCompilerConfiguration.java/1.10/Sat Feb 28 19:04:47 2004//
-/TestCompilerConfiguration.java/1.9/Tue May 11 03:50:13 2004//
-/TestLinkType.java/1.2/Sat Feb 28 19:04:47 2004//
-D
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Repository b/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Repository
deleted file mode 100644
index 494317a..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-cpptasks/test/junit/net/sf/antcontrib/cpptasks/compiler
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Root b/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Root
deleted file mode 100644
index 5e83ed6..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ant-contrib
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractCompiler.java b/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractCompiler.java
deleted file mode 100644
index 5a1e66b..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractCompiler.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CompilerDef;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-import net.sf.antcontrib.cpptasks.VersionInfo;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Test for abstract compiler class
- *
- * Override create to test concrete compiler implementions
- */
-public class TestAbstractCompiler extends TestAbstractProcessor {
- private class DummyAbstractCompiler extends AbstractCompiler {
- public DummyAbstractCompiler() {
- super(new String[]{".cpp", ".c"},
- new String[]{".hpp", ".h", ".inl"}, ".o");
- }
- public void compile(CCTask task, File[] srcfile, File[] outputfile,
- CompilerConfiguration config) throws BuildException {
- throw new BuildException("Not implemented");
- }
- public CompilerConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] def1, CompilerDef def2,
- net.sf.antcontrib.cpptasks.TargetDef targetPlatform,
- VersionInfo versionInfo) {
- return null;
- }
- public Parser createParser(File file) {
- return new CParser();
- }
- public String getIdentifier() {
- return "dummy";
- }
- public Linker getLinker(LinkType type) {
- return null;
- }
- }
- public TestAbstractCompiler(String name) {
- super(name);
- }
- protected AbstractProcessor create() {
- return new DummyAbstractCompiler();
- }
- protected String getObjectExtension() {
- return ".o";
- }
- public void testCanParseTlb() {
- AbstractCompiler compiler = (AbstractCompiler) create();
- assertEquals(false, compiler.canParse(new File("sample.tlb")));
- }
- public void testGetOutputFileName1() {
- AbstractProcessor compiler = create();
- String[] output = compiler.getOutputFileNames("c:/foo\\bar\\hello.c", null);
- assertEquals("hello" + getObjectExtension(), output[0]);
- output = compiler.getOutputFileNames("c:/foo\\bar/hello.c", null);
- assertEquals("hello" + getObjectExtension(), output[0]);
- output = compiler.getOutputFileNames("hello.c", null);
- assertEquals("hello" + getObjectExtension(), output[0]);
- output = compiler.getOutputFileNames("c:/foo\\bar\\hello.h", null);
- assertEquals(0, output.length);
- output = compiler.getOutputFileNames("c:/foo\\bar/hello.h", null);
- assertEquals(0, output.length);
- }
-}
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractLinker.java b/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractLinker.java
deleted file mode 100644
index b444a0a..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractLinker.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.LinkerDef;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-import net.sf.antcontrib.cpptasks.TargetDef;
-import net.sf.antcontrib.cpptasks.VersionInfo;
-
-/**
- * Test for abstract compiler class
- *
- * Override create to test concrete compiler implementions
- */
-public class TestAbstractLinker extends TestAbstractProcessor {
- private class DummyAbstractLinker extends AbstractLinker {
- public DummyAbstractLinker() {
- super(new String[]{".obj", ".lib"}, new String[]{".map", ".exp"});
- }
- public LinkerConfiguration createConfiguration(final CCTask task,
- final LinkType linkType,
- final ProcessorDef[] def1,
- final LinkerDef def2,
- final TargetDef targetPlatform,
- final VersionInfo versionInfo) {
- return null;
- }
- public String getIdentifier() {
- return "dummy";
- }
- public File[] getLibraryPath() {
- return new File[0];
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return libnames;
- }
- public Linker getLinker(LinkType type) {
- return null;
- }
- public String[] getOutputFileNames(String sourceFile, VersionInfo versionInfo) {
- return new String[0];
- }
- public String[][] getRuntimeLibraries(boolean debug,
- boolean multithreaded, boolean staticLink) {
- return new String[2][0];
- }
- public boolean isCaseSensitive() {
- return true;
- }
- }
- public TestAbstractLinker(String name) {
- super(name);
- }
- protected AbstractProcessor create() {
- return new DummyAbstractLinker();
- }
- public void testBid() {
- AbstractProcessor compiler = create();
- int bid = compiler.bid("c:/foo\\bar\\hello.obj");
- assertEquals(100, bid);
- bid = compiler.bid("c:/foo\\bar/hello.lib");
- assertEquals(100, bid);
- bid = compiler.bid("c:/foo\\bar\\hello.map");
- assertEquals(0, bid);
- bid = compiler.bid("c:/foo\\bar/hello.map");
- assertEquals(0, bid);
- bid = compiler.bid("c:/foo\\bar/hello.c");
- assertEquals(1, bid);
- bid = compiler.bid("c:/foo\\bar/hello.cpp");
- assertEquals(1, bid);
- }
-}
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractProcessor.java b/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractProcessor.java
deleted file mode 100644
index f2c04a3..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestAbstractProcessor.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import junit.framework.TestCase;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.VersionInfo;
-/**
- * Test for abstract compiler class
- *
- * Override create to test concrete compiler implementions
- */
-public class TestAbstractProcessor extends TestCase {
- private class DummyAbstractProcessor extends AbstractProcessor {
- public DummyAbstractProcessor() {
- super(new String[]{".cpp", ".c"},
- new String[]{".hpp", ".h", ".inl"});
- }
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] defaultProvider,
- ProcessorDef specificProvider,
- net.sf.antcontrib.cpptasks.TargetDef targetPlatform,
- VersionInfo versionInfo) {
- return null;
- }
- public String getIdentifier() {
- return "dummy";
- }
- public Linker getLinker(LinkType type) {
- return null;
- }
- public String[] getOutputFileNames(String sourceFile, VersionInfo versionInfo) {
- return new String[0];
- }
- public String[][] getRuntimeLibraries(boolean debug,
- boolean multithreaded, boolean staticLink) {
- return new String[2][0];
- }
- }
- public TestAbstractProcessor(String name) {
- super(name);
- }
- protected AbstractProcessor create() {
- return new DummyAbstractProcessor();
- }
- public void testBid() {
- AbstractProcessor compiler = create();
- int bid = compiler.bid("c:/foo\\bar\\hello.c");
- assertEquals(100, bid);
- bid = compiler.bid("c:/foo\\bar/hello.c");
- assertEquals(100, bid);
- bid = compiler.bid("c:/foo\\bar\\hello.h");
- assertEquals(1, bid);
- bid = compiler.bid("c:/foo\\bar/hello.h");
- assertEquals(1, bid);
- bid = compiler.bid("c:/foo\\bar/hello.pas");
- assertEquals(0, bid);
- bid = compiler.bid("c:/foo\\bar/hello.java");
- assertEquals(0, bid);
- }
- public void testGetIdentfier() {
- AbstractProcessor compiler = create();
- String id = compiler.getIdentifier();
- assertEquals("dummy", id);
- }
-}
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestCommandLineCompilerConfiguration.java b/test/junit/net/sf/antcontrib/cpptasks/compiler/TestCommandLineCompilerConfiguration.java
deleted file mode 100644
index a22fa0d..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestCommandLineCompilerConfiguration.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-import net.sf.antcontrib.cpptasks.gcc.GccCCompiler;
-/**
- */
-public class TestCommandLineCompilerConfiguration
- extends
- TestCompilerConfiguration {
- private final CommandLineCompiler compiler;
- private final String compilerId;
- public TestCommandLineCompilerConfiguration(String name) {
- super(name);
- compiler = (GccCCompiler) GccCCompiler.getInstance();
- compilerId = compiler.getIdentifier();
- }
- protected CompilerConfiguration create() {
- return new CommandLineCompilerConfiguration(compiler, "dummy",
- new File[0], new File[0], new File[0], "",
- new String[]{"/Id:/gcc"}, new ProcessorParam[0], false,
- new String[0]);
- }
- public void testConstructorNullCompiler() {
- try {
- new CommandLineCompilerConfiguration(null, "dummy", new File[0],
- new File[0], new File[0], "", new String[0],
- new ProcessorParam[0], false, new String[0]);
- fail("Should throw exception for null compiler");
- } catch (NullPointerException ex) {
- }
- }
- public void testGetIdentifier() {
- CompilerConfiguration config = create();
- String id = config.getIdentifier();
- assertEquals("dummy", id);
- }
- public void testToString() {
- CompilerConfiguration config = create();
- String toString = config.toString();
- assertEquals("dummy", toString);
- }
-}
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestCompilerConfiguration.java b/test/junit/net/sf/antcontrib/cpptasks/compiler/TestCompilerConfiguration.java
deleted file mode 100644
index a928ae4..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestCompilerConfiguration.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import junit.framework.TestCase;
-/**
- */
-public abstract class TestCompilerConfiguration extends TestCase {
- public TestCompilerConfiguration(String name) {
- super(name);
- }
- protected abstract CompilerConfiguration create();
- public String getObjectFileExtension() {
- return ".o";
- }
- public void testBid() {
- CompilerConfiguration compiler = create();
- int bid = compiler.bid("c:/foo\\bar\\hello.c");
- assertEquals(100, bid);
- bid = compiler.bid("c:/foo\\bar/hello.c");
- assertEquals(100, bid);
- bid = compiler.bid("c:/foo\\bar\\hello.h");
- assertEquals(1, bid);
- bid = compiler.bid("c:/foo\\bar/hello.h");
- assertEquals(1, bid);
- bid = compiler.bid("c:/foo\\bar/hello.pas");
- assertEquals(0, bid);
- bid = compiler.bid("c:/foo\\bar/hello.java");
- assertEquals(0, bid);
- }
- public void testGetOutputFileName1() {
- CompilerConfiguration compiler = create();
- String input = "c:/foo\\bar\\hello.c";
- //
- // may cause IllegalStateException since
- // setPlatformInfo has not been called
- try {
- String[] output = compiler.getOutputFileNames(input, null);
- } catch (java.lang.IllegalStateException ex) {
- }
- }
- public void testGetOutputFileName2() {
- CompilerConfiguration compiler = create();
- String[] output = compiler.getOutputFileNames("c:/foo\\bar\\hello.c", null);
- assertEquals("hello" + getObjectFileExtension(), output[0]);
- output = compiler.getOutputFileNames("c:/foo\\bar/hello.c", null);
- assertEquals("hello" + getObjectFileExtension(), output[0]);
- output = compiler.getOutputFileNames("hello.c", null);
- assertEquals("hello" + getObjectFileExtension(), output[0]);
- output = compiler.getOutputFileNames("c:/foo\\bar\\hello.h", null);
- assertEquals(0, output.length);
- output = compiler.getOutputFileNames("c:/foo\\bar/hello.h", null);
- assertEquals(0, output.length);
- }
-}
diff --git a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestLinkType.java b/test/junit/net/sf/antcontrib/cpptasks/compiler/TestLinkType.java
deleted file mode 100644
index a7e3a45..0000000
--- a/test/junit/net/sf/antcontrib/cpptasks/compiler/TestLinkType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import junit.framework.TestCase;
-import net.sf.antcontrib.cpptasks.OutputTypeEnum;
-/**
- * Tests for LinkType
- *
- * @author CurtA
- */
-public class TestLinkType extends TestCase {
- /**
- * Constructor
- *
- * @param name
- * test case name
- */
- public TestLinkType(String name) {
- super(name);
- }
- /**
- * Tests if isPluginModule returns true when set to plugin output type
- *
- * See patch [ 676276 ] Enhanced support for Mac OS X
- */
- public void testIsPluginFalse() {
- LinkType type = new LinkType();
- OutputTypeEnum pluginType = new OutputTypeEnum();
- pluginType.setValue("executable");
- type.setOutputType(pluginType);
- assertTrue(!type.isPluginModule());
- }
- /**
- * Tests if isPluginModule returns true when set to plugin output type
- *
- * See patch [ 676276 ] Enhanced support for Mac OS X
- */
- public void testIsPluginTrue() {
- LinkType type = new LinkType();
- OutputTypeEnum pluginType = new OutputTypeEnum();
- pluginType.setValue("plugin");
- type.setOutputType(pluginType);
- assertTrue(type.isPluginModule());
- }
-}