Caché %UnitTest Tutorial
RunTest Examples
[Home] [Back] [Next]
InterSystems: The power behind what matters   

Here are some examples of using RunTest to execute your unit tests.

In order to use RunTest, you must first assign ^UnitTestRoot a valid directory name:
USER>Set ^UnitTestRoot = "C:\UnitTests"
Example 1:
USER>Do ##class(%UnitTest.Manager).RunTest()
Example 2:
USER>Do ##class(%UnitTest.Manager).RunTest("mytests")
Example 3:
USER>Do ##class(%UnitTest.Manager).RunTest("mytests:MyPackage.Tests")
Example 4:
USER>Do ##class(%UnitTest.Manager).RunTest("mytests:MyPackage.Tests", "/noload/nodelete")
The test classes in the subdirectories of ^UnitTestRoot must be contained in the XML files that result from exporting the test classes, possibly along with other classes, from Caché.

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA