Simulation of cruise control "!" character in NAnt file

I have Cruise Control configured with a task to run an NAnt script that launches the MSTest suite. MSTest allows me to specify test categories, so I want to specify "! Integration" (which means "do not run integration tests"). My Nant script runs successfully when I run it from the command line, but when Cruise starts it, the "! Integration" directive is distorted - Cruise's output suggests inserting a line break after the "!" Character. As a result, all my tests are performed, including integration tests.

Extract from ccnet.config:

<tasks>
  <nant>
    <executable>C:\nant\bin\nant.exe</executable>
    <baseDirectory>C:\MyProject\BuildDirectory</baseDirectory>
    <buildFile>MyProject.build</buildFile>
    <targetList>
       <target>CIServerBuild</target>  
    </targetList>
  </nant>
</tasks>

Extract from MyProject.build:

<target name="CIServerBuild">
      :
    <call target="RunUnitTests" />
</target>

<target name="RunUnitTests">
    <property name="TestCategories" value="!Integration" />
    <call target="RunMSTest"  failonerror="true"/>
</target>

<target name="RunMSTest">
    <call target="BuildListOfTestContainers"  failonerror="true"/>
    <exec program="${MSTest.exe}"
        commandline=" /category:&quot;${TestCategories}&quot; ${TestContainers} /resultsfile:${MSTest.ResultsFile} /nologo "
     />
</target>

Excerpt from cruise exit:

[exec] Starting 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe ( /category:"!
Integration" /testcontainer:C:\TaxWise\BuildDirectory\TaxWise\TaxWise.Data.Tests\bin\Debug\TaxWise.Data.Tests.dll /testcontainer:C:\TaxWise\BuildDirectory\TaxWise\TaxWise.Domain.Tests\bin\Debug\TaxWise.Domain.Tests.dll /testcontainer:C:\TaxWise\BuildDirectory\TaxWise\TaxWise.Infrastructure.Tests\bin\Debug\TaxWise.Infrastructure.Tests.dll /resultsfile:.\TestResults\UnitTests.trx /nologo )' 
in 'C:\TaxWise\BuildDirectory'

I tried replacing '!' symbol with

'&#33;' 

but it didn’t matter.

Any ideas anyone?

+5
2

, , CC. verbose="True" <exec> raw build. , , , ( ).

, , script, . , <exec program="cmd.exe" commandline="/c set" />. script:

 <script language="C#" prefix="util" verbose="true">
    <code>
        <![CDATA[
        public static void ScriptMain(Project project) 
        {
            foreach (DictionaryEntry entry in new System.Collections.SortedList(project.Properties) ) 
                Console.WriteLine("{0}={1}", entry.Key, entry.Value); 
        }
        ]]>
    </code>
  </script>
0

All Articles