Lighthouse Command Line Unit Test Runner supports following parameters and arguments: 

  1. -m (-Mode) – sets the mode of operation. 
    Possible values of mode parameter are: Xap and Dll
    Xap mode value (default) is used when you want to test complete Silverlight Unit Testing Framework XAP file with tests and code all bundled inside of it.
    Dll mode value is used if you want to specify the Silverlight assemblies (DLL’s) that you want to test. You can specify DLL’s with Unit Tests and DLL’s that are just referenced and are
    needed to run the tests.

    When using XAP mode, then first argument is XAP file Path and second argument is the file where to save XML results of the Unit Tests:
    Lighthouse.exe –m:Xap D:\Xaps\AppWithUnitTests.xap D:\tmp\TestResults.xml

    Same is without specifying the mode parameter since Xap mode is default one:
    Lighthouse.exe D:\Xaps\AppWithUnitTests.xap D:\tmp\TestResults.xml

    When using DLL mode, just specify manually Assemblies with tests (-tests) and other needed Assemblies (-references) followed by XML output file name:
    Lighthouse.exe –m:Dll -tests:"D:\tmp\MyTests.dll" -references:"D:\tmp\Code1.dll,D:\tmp\Code2.dll" D:\tmp\results.xml
    (Only make sure you do not put empty space between multiple assemblies, only commas are allowed between them).

    In DLL mode you can also freely (ab)use the standards wildcards (*?):
    Lighthouse.exe –m:Dll -tests:"D:\tmp\MyTests.dll" -references:"D:\tmp\Code*.dll" D:\tmp\results.xml

  2. -tf (-TagFilter) specifies the Tag Filter to limit the execution to Unit Tests that are market with this Tag.
    You can use here any TagFilter supported by Silverlight Unit Testing Framework.

    So in order to run only tests marked with tag “Critical” you would use this command line:
    Lighthouse.exe D:\Xaps\AppWithUnitTests.xap D:\tmp\TestResults.xml –tf:”Critical” 
  3. -tm (-TimeOut) Specifies the sliding timeout value in seconds – default value is 60 seconds.
    Sliding timeout works like a watch dog and resets and starts counting every time Lighthouse receives some results from the running tests. If this timeout expires Unit Test execution
    is interrupted and considered as failed. Off course in the XML results file you can see only results of the Unit Tests that were returned until then. In the Log File (if you specify it)
    you can also see which Unit Tests were started but did not returned results – possible causes of the Timeout.

  4. -lf (-LogFile) (-Log)  – Specifies to what file to log all the output of the Unit Test Run.
    Lighthouse.exe –m:Xap D:\Xaps\AppWithUnitTests.xap D:\tmp\TestResults.xml –lf:"D:\tmp\log.txt”

  5. -cnp (-CleanUp) - Cleanup mode.
    Possible values:
    -cnp:On – All temp files created by the Lighthouse are deleted after Unit Testing is finished (default value)
    -cnp:Off – None of the temporary files created by the Lighthouse are deleted after Unit Testing is finished – good if you want to debug or see how Lighthouse works.

  6. -wd (-WorkDir)  - Specifies the Working Directory where Lighthouse will create all the Temp files needed for Unit Test execution. By default Lighthouse uses Users Temp
    directory but if you specify this parameter then this is overridden.

Last edited Mar 21, 2011 at 4:50 PM by spavkov, version 7


No comments yet.