Studio:SCL Samples
Introduction
The following content relates to the sample files and workspaces installed in %STRIDE_DIR%\Samples\SCL. This sample consists of a Visual Studio workspace for building an off-target simulator, sample STRIDE Communication Language (SCL) source code, and a STRIDE workspace for sample code 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 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 sample source code.
Once the build is complete, perform the following steps to run the sample scripts in the workspace:
- launch the off-target simulator, SCL_Samples.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 WorkspaceRun.pl -x setup -x teardown. This will execute all of the sample test scripts in the workspace and displays the results. You may open a browser and display the report written to the SCL_Samples.html file in the sample's directory .
- quit the SCL_Samples.exe application by typing 'q' in its console window.
Sample Tests
Now that you have built the off-target simulator and executed the SCL sample code it contains, you can take time to peruse the sample source and the corresponding results that each produces. This section provides a brief description for each.
Capturing Functions
Capturing Messages
Qualifying Casts
Qualifying Pointers
Qualifying Strings
Qualifying Unions
Qualifying Function Callbacks
Constraining Values
Test Execution
This sample demonstrates two different techniques for executing the sample test scripts.
Command Line Execution
Command line execution for sample STRIDE test workspace is done using the WorkspaceRun utility. Here is an example of specific syntax to execute a test workspace. All of these commands can be invoked from a standard command shell (or other shell of your choosing) and the arguments shown assume that the commands are executed with the sample's directory as the starting directory. You must have your SCL_Samples.exe application running in order for the runner to be able to initiate a connection to the target simulator.
WorkspaceRun.pl -x setup -x teardown
When you run this command, you should see console output like:
Opening workspace C:\S2\Seaside\Samples\SCL/SCL_Samples.ssw.. excluding folder setup in workspace C:\S2\Seaside\Samples\SCL/SCL_Samples.ssw running folder test in workspace C:\S2\Seaside\Samples\SCL/SCL_Samples.ssw excluding folder teardown in workspace C:\S2\Seaside\Samples\SCL/SCL_Samples.ssw Test results written to C:\S2\Seaside\Samples\SCL\SCL_Samples.html *************************************************************************** Results Summary *************************************************************************** Passed: 19 Failed: 0 In Progress: 0 Not Applicable: 0 ...in 11 suites. ***************************************************************************
Workspace-Based Execution
When opened with STRIDE Studio the sample STRIDE workspace (.ssw) a user could manage test order and hierarchy. The setup and teardown folders provide basic infrastructure scripts that start/stop the simulator application (SCL_Samples.exe) and to manage traceviews used for srPrint message collection. The scripts that drive the testing are in the workspace test folder. What follows is a brief description for each.
Capture
This folder contains samples that demonstrate how to use SCL to identify and define interfaces on the target.
Functions
This folder contains a script that demonstrate how to make the IM generated function proxy to call the host.
Qualification
This folder contains samples that demonstrate how to use SCL to annotate or markup interface payloads for communication with the target.
Casting
This folder contains a script that demonstrates
FunctionCallbacks
This folder contains a script that demonstrates
Pointers
This folder contains a script that demonstrates
Strings
This folder contains a script that demonstrates