Test Class Sample: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
The following content relates to the sample files and workspaces installed in %STRIDE_DIR%\Samples\TestUnits\TestClass. This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building | The following content relates to the sample files and workspaces installed in ''%STRIDE_DIR%\Samples\TestUnits\TestClass''. This sample consists of a [http://en.wikipedia.org/wiki/Microsoft_Visual_Studio Visual Studio] workspace for building an [[Windows_Off-Target_Apps| off-target simulator]], sample [[Test Units|test class]] source code, and a STRIDE workspace for doing more advanced test class execution. | ||
==Getting Started== | ==Getting Started== | ||
To begin, open the Visual Studio Solution file in the sample directory. This solution (and corresponding project) were created for Visual Studio 2005. If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary. If you do not currently have any version of Visual Studio, we recommend that you install the current free (as in beer) version of [http://en.wikipedia.org/wiki/Visual_Studio_Express Visual Studio Express]. | |||
Once you have successfully opened the solution, rebuild it. The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and an off-target simulator application that incorporates the test class source. | |||
Once the build is complete, perform the following steps to run the test classes in the workspace: | |||
# launch the off-target simulator, TestClass.exe. This will run in a standard console window. | |||
# open a command prompt window and change to this sample's directory. | |||
# at the command prompt, run the command <tt>TestUnitRun.pl -v</tt>. This will execute all of the test units in the workspace and open a browser to display the results. | |||
# quit the TestClass.exe application by typing 'q' in its console window. | |||
==Sample Test Classes== | ==Sample Test Classes== | ||
===Basic Examples=== | |||
===Runtime Services Examples=== | |||
===srTest Examples=== | |||
==Test Class Execution== | ==Test Class Execution== |
Revision as of 00:03, 19 July 2008
Introduction
The following content relates to the sample files and workspaces installed in %STRIDE_DIR%\Samples\TestUnits\TestClass. This sample consists of a Visual Studio workspace for building an off-target simulator, sample test class source code, and a STRIDE workspace for doing more advanced test class execution.
Getting Started
To begin, open the Visual Studio Solution file in the sample directory. This solution (and corresponding project) were created for Visual Studio 2005. If you have a later version of Visual Studio installed, you should be able to open this solution and it will be automatically upgraded if necessary. If you do not currently have any version of Visual Studio, we recommend that you install the current free (as in beer) version of Visual Studio Express.
Once you have successfully opened the solution, rebuild it. The build process has custom STRIDE build rules integrated and will produce a STRIDE database, intercept module source files, and an off-target simulator application that incorporates the test class source.
Once the build is complete, perform the following steps to run the test classes in the workspace:
- launch the off-target simulator, TestClass.exe. This will run in a standard console window.
- open a command prompt window and change to this sample's directory.
- at the command prompt, run the command TestUnitRun.pl -v. This will execute all of the test units in the workspace and open a browser to display the results.
- quit the TestClass.exe application by typing 'q' in its console window.