net.sf.antcontrib.cpptasks.types
Class TestLibrarySet

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by net.sf.antcontrib.cpptasks.types.TestLibrarySet
All Implemented Interfaces:
junit.framework.Test

public class TestLibrarySet
extends junit.framework.TestCase

Tests for the LibrarySet class.


Constructor Summary
TestLibrarySet(java.lang.String name)
          Constructor.
 
Method Summary
 void testBadLibname()
          This test specifies a library pattern that should not match any available libraries and expects that a build exception will be raised.
 void testIsActive1()
          Evaluate isActive when "if" specifies a property that is set.
 void testIsActive2()
          Evaluate isActive when "if" specifies a property whose value suggests the user thinks the value is significant.
 void testIsActive3()
          Evaluate isActive when "if" specifies a property that is not set.
 void testIsActive4()
          Evaluate isActive when "unless" specifies a property that is set.
 void testIsActive5()
          Evaluate isActive when "unless" specifies a property whose value suggests the user thinks the value is significant.
 void testIsActive6()
          Evaluate isActive when "unless" specifies a property that is not set.
 void testLibContainsDot()
          The libs parameter should not end with .lib, .so, .a etc New behavior is to warn if it ends in a suspicious extension.
 void testLibContainsDotLib()
          The libs parameter should not end with .lib, .so, .a (that is, should be kernel, not kernel.lib).
 void testLibNotSpecified()
          Use of a libset or syslibset without a libs attribute should log a warning message.
 void testLibrarianVisitFiles()
          Run testVisitFiles with the MSVC Librarian expect one matching file.
 void testLinkerVisitFiles()
          Run testVisitFiles with the MSVC Linker expect one matching file.
 void testShortLibName()
          this threw an exception prior to 2002-09-05 and started to throw one again 2002-11-19 up to 2002-12-11.
 void testStartsWithLib()
          The libs parameter should contain not a lib prefix (that is, pthread not libpthread).
 void testVisitFiles(net.sf.antcontrib.cpptasks.compiler.Linker linker, int expected)
          This test creates two "fake" libraries in the temporary directory and check how many are visited.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestLibrarySet

public TestLibrarySet(java.lang.String name)
Constructor.

Parameters:
name - test name
Method Detail

testIsActive1

public final void testIsActive1()
Evaluate isActive when "if" specifies a property that is set.


testIsActive2

public final void testIsActive2()
Evaluate isActive when "if" specifies a property whose value suggests the user thinks the value is significant.


testIsActive3

public final void testIsActive3()
Evaluate isActive when "if" specifies a property that is not set.


testIsActive4

public final void testIsActive4()
Evaluate isActive when "unless" specifies a property that is set.


testIsActive5

public final void testIsActive5()
Evaluate isActive when "unless" specifies a property whose value suggests the user thinks the value is significant.


testIsActive6

public final void testIsActive6()
Evaluate isActive when "unless" specifies a property that is not set.


testLibContainsDot

public final void testLibContainsDot()
The libs parameter should not end with .lib, .so, .a etc New behavior is to warn if it ends in a suspicious extension.


testLibContainsDotLib

public final void testLibContainsDotLib()
The libs parameter should not end with .lib, .so, .a (that is, should be kernel, not kernel.lib). Previously the libset would warn on configuration, now provides more feedback when library is not found.


testLibNotSpecified

public final void testLibNotSpecified()
Use of a libset or syslibset without a libs attribute should log a warning message.


testShortLibName

public final void testShortLibName()
this threw an exception prior to 2002-09-05 and started to throw one again 2002-11-19 up to 2002-12-11.


testStartsWithLib

public final void testStartsWithLib()
The libs parameter should contain not a lib prefix (that is, pthread not libpthread). Previously the libset would warn on configuration, now provides more feedback when library is not found.


testVisitFiles

public final void testVisitFiles(net.sf.antcontrib.cpptasks.compiler.Linker linker,
                                 int expected)
                          throws java.io.IOException
This test creates two "fake" libraries in the temporary directory and check how many are visited.

Parameters:
linker - linker
expected - expected number of visited files
Throws:
java.io.IOException - if unable to write to temporary directory or delete temporary files

testLinkerVisitFiles

public final void testLinkerVisitFiles()
                                throws java.io.IOException
Run testVisitFiles with the MSVC Linker expect one matching file.

Throws:
java.io.IOException - if unable to create or delete temporary file

testLibrarianVisitFiles

public final void testLibrarianVisitFiles()
                                   throws java.io.IOException
Run testVisitFiles with the MSVC Librarian expect one matching file.

Throws:
java.io.IOException - if unable to create or delete temporary file

testBadLibname

public final void testBadLibname()
This test specifies a library pattern that should not match any available libraries and expects that a build exception will be raised. See bug 1380366



Copyright © 2001-2008 Ant-Contrib Project. All Rights Reserved.