Difference between revisions of "Test Integration"

From STRIDE Wiki
Jump to: navigation, search
(Running the TestIntro Tests)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
In this article, we discuss adding tests to your target build, running these tests and publishing results to [[STRIDE Test Space]].
+
In this article, we discuss adding tests to your target build and running these tests.
  
The starting point of this article assumes that your have completed the steps described in the article [[Test Integration]].
+
The starting point of this article assumes that you have completed the steps described in the article [[Build Integration]].
 
 
== Creating Test Space Containers ==
 
As a first step, we must create a '''Project''' and '''Test Space''' into which our test results will be uploaded.
 
[[image:TestIntro_Testspace.jpg|thumb||Newly created TestIntro Test Space]]
 
 
 
# Using your web browser, navigate to your company's testspace site and login<ref>Your testspace URL and login credentials are provided by S2 Technologies</ref>
 
# Click on the '''All Projects''' tab, then click the '''Create New Test Space''' button.
 
# If your company's site doesn't have any Projects defined you will be prompted to create a new project. If that is the case, follow these sub-steps:
 
## Fill in the '''Name''' as: Stride Deployment
 
## Fill in the '''Description''' as: sandbox for deployment tests
 
## Ensure that the '''Active''' box is checked
 
## Click the '''Create''' button
 
# At the top of the '''New s2_test_space''' page, enter text as follows:
 
#* '''Name:''' TestIntro
 
#* '''Description:''' testintro sample tests
 
#* '''Max results to keep:''' 10
 
# If you would like to grant access to other users, check the appropriate boxes in the '''additional users''' section
 
# For now, skip the '''auto compare''' options, you can change these (and other options) later if desired
 
# In the Project list box, choose ''Stride Deployment''. If this isn't available, click the '''New Project...''' link and enter the project name and description as described earlier
 
# Finally, click the '''create''' button
 
# On the subsequent page that is displayed, you will be able to manually upload results data, but leave the browser as it is, we will be automatically uploading results in a later step.
 
  
 
== Adding the TestIntro Tests to the Target Build ==
 
== Adding the TestIntro Tests to the Target Build ==
Here we will add the [[Test Intro Sample|TestIntro sample tests]] to the target build.<ref>The TestIntro sample is distributed in the [[Package_Installation#Samples|Samples package]].</ref> We will use the same technique used earlier in the [[Test_Integration#Building_the_Target_with_STRIDE_Diagnostics|Test Integration]] to incorporate these tests.
+
Here we will add the [[Test Intro Sample|TestIntro sample tests]] to the target build.<ref>The TestIntro sample is distributed in the [[Distribution Files#Samples|Samples package]].</ref> We will use the same technique used earlier in the [[Build_Integration#Building_the_Target_with_STRIDE_Diagnostics|Build Integration]] to incorporate these tests.
  
The [[Test Unit Pragmas|SCL pragmas]] that declare the TestIntro test units are in the file <tt>s2_testintro_test.h</tt>, so this file needs to be supplied as input to the STRIDE build tools. If you are using the Makefile technique described in [[Test_Integration#Build_Tool_Inputs|TestIntegration]], you simply need to add <tt>[path]Samples/TestIntro</tt> to the <tt>SCL_DIRS</tt> variable so that it will be picked up as input to <tt>s2scompile</tt>.  
+
The [[Test Unit Pragmas|SCL pragmas]] that declare the TestIntro test units are in the file <tt>s2_testintro_test.h</tt>, so this file needs to be supplied as input to the STRIDE build tools. If you are using the Makefile technique described in [[Build_Integration#Build_Tool_Inputs|Build Integration]], you simply need to add <tt>[path]Samples/TestIntro/s2_testintro_test.h</tt> to the <tt>SCL_SRCS_H</tt> variable so that it will be picked up as input to <tt>s2scompile</tt>.  
  
 
In addition, you need to include the TestIntro source files in the target compile/link.
 
In addition, you need to include the TestIntro source files in the target compile/link.
Line 33: Line 12:
 
Once the build is complete, download the binary to the target in preparation of running the tests.
 
Once the build is complete, download the binary to the target in preparation of running the tests.
  
== Running and Publishing the TestIntro Tests ==
+
== Running the TestIntro Tests ==
To execute the TestIntro tests, use a Windows or Linux host computer that has connectivity with the target system via your configured STRIDE transport (TCP/IP or serial). Additionally, make the generated STRIDE database (.sidb) visible to the host computer via a shared filesystem or a file copy to the host system.
+
To execute the TestIntro tests, use a Windows, Linux or FreeBSD host computer that has connectivity with the target system via your configured STRIDE transport (TCP/IP or serial). Additionally, make the generated STRIDE database (.sidb) visible to the host computer via a shared filesystem or a file copy to the host system.
 
 
If not already present, install the appropriate [[Package_Installation#Host_Tools | Host Tools]] package on the host computer.
 
 
 
We will now run [[Stride Runner|stride]] with options instructing it to upload results to your company's [[STRIDE Test Space|TestSpace site]]. The command line gets rather long when all the needed options are specified, so it's recommended that you create an options file to submit the command line options.
 
  
Create a text file named <tt>TestIntroOpts.txt</tt> and add the following text. You will need to fill in your particular argument values where brackets [ ] are shown. Note that the --project and --space argument values must match pre-existing containers on your TestSpace site.
+
If not already present, install the appropriate [[Desktop_Installation | desktop Framework package]] on the host computer.
 
 
<pre>
 
-r /(*)
 
--database [path]/stride.sidb
 
--device [device_address]
 
-u
 
--testspace [https://user:pwd@mycompany.stridetestspace.com]
 
--project "Stride Deployment"
 
--space TestIntro
 
</pre>
 
  
To run and upload the tests, ensure that your target system is running and that your host computer is connected to the Internet, then enter the following in a host console:
+
To run the tests, ensure that your target system is running, then enter the following in a host console:
 
<source lang="bash">
 
<source lang="bash">
stride -O TestIntroOpts.txt
+
stride --database=<path>/stride.sidb --device=<device_address> --run="*"
 
</source>
 
</source>
  
Line 61: Line 26:
 
Loading database...
 
Loading database...
 
Connecting to device...
 
Connecting to device...
  runtime version: 4.2.xx
 
 
Executing test units...
 
Executing test units...
 
   s2_testintro_cclass
 
   s2_testintro_cclass
Line 76: Line 40:
 
Disconnecting from device...
 
Disconnecting from device...
 
Saving result file...
 
Saving result file...
Uploading to test space...
 
 
</pre>
 
</pre>
  
Notice that the last line indicates that the results are being uploaded to test space.
+
=== Uploading and Viewing Results in Test Space ===
 +
Optionally, if you have Internet connectivity and access to your company's [[STRIDE Test Space|Test Space]]<ref>You need to have an account with access to a dedicated "Stride Deployment" project and "TestIntro" space created by your Test Space administrator</ref> you could run again the TestIntro tests and upload the results by executing:
 +
 
 +
<source lang="bash">
 +
stride --database=<path>/stride.sidb --device=<device_address> -u --testspace=<user>:<pwd>@<mycompany>.stridetestspace.com --project="Stride Deployment" --space=TestIntro --run="*"
 +
</source>
  
== Viewing Results in Test Space ==
 
 
[[image:TestIntro_spacepage.jpg|thumb||TestIntro Test Space Page]]
 
[[image:TestIntro_spacepage.jpg|thumb||TestIntro Test Space Page]]
Returning to your web browser, login to your company's test space site if needed and navigate to the '''All Projects''' page.
+
Open your web browser, login to your company's test space site if needed and navigate to the '''All Projects''' page.
  
 
You should now see the '''TestIntro''' test space listed under the '''Stride Deployment''' project, and see that TestIntro's '''Result Set Count''' is now 1.
 
You should now see the '''TestIntro''' test space listed under the '''Stride Deployment''' project, and see that TestIntro's '''Result Set Count''' is now 1.
  
 
Click on the '''TestIntro''' link to be presented with the '''TestIntro''' space page. At the bottom of the page you will see a table displaying the uploaded result sets for this test space. Click on the '''Sequence_1''' link to show detailed results for this test run.
 
Click on the '''TestIntro''' link to be presented with the '''TestIntro''' space page. At the bottom of the page you will see a table displaying the uploaded result sets for this test space. Click on the '''Sequence_1''' link to show detailed results for this test run.
 
<hr/>
 
  
 
== Notes ==
 
== Notes ==
 
<references/>
 
<references/>
[[Category:Framework Integration]]
+
 
 +
[[Category:Installation]]

Latest revision as of 17:22, 25 September 2013

In this article, we discuss adding tests to your target build and running these tests.

The starting point of this article assumes that you have completed the steps described in the article Build Integration.

Adding the TestIntro Tests to the Target Build

Here we will add the TestIntro sample tests to the target build.[1] We will use the same technique used earlier in the Build Integration to incorporate these tests.

The SCL pragmas that declare the TestIntro test units are in the file s2_testintro_test.h, so this file needs to be supplied as input to the STRIDE build tools. If you are using the Makefile technique described in Build Integration, you simply need to add [path]Samples/TestIntro/s2_testintro_test.h to the SCL_SRCS_H variable so that it will be picked up as input to s2scompile.

In addition, you need to include the TestIntro source files in the target compile/link.

Once the build is complete, download the binary to the target in preparation of running the tests.

Running the TestIntro Tests

To execute the TestIntro tests, use a Windows, Linux or FreeBSD host computer that has connectivity with the target system via your configured STRIDE transport (TCP/IP or serial). Additionally, make the generated STRIDE database (.sidb) visible to the host computer via a shared filesystem or a file copy to the host system.

If not already present, install the appropriate desktop Framework package on the host computer.

To run the tests, ensure that your target system is running, then enter the following in a host console:

stride --database=<path>/stride.sidb --device=<device_address> --run="*"

The text below should be output to your host console as the test progresses.

Loading database...
Connecting to device...
Executing test units...
  s2_testintro_cclass
    > 1 passed, 1 failed, 0 in progress, 0 not in use.
  s2_testintro_flist
    > 2 passed, 1 failed, 0 in progress, 0 not in use.
  s2_testintro_testdoubles
    > 3 passed, 0 failed, 0 in progress, 0 not in use.
  s2_testintro_testpoints
    > 3 passed, 0 failed, 0 in progress, 0 not in use.
  ---------------------------------------------------------------------
  Summary: 9 passed, 2 failed, 0 in progress, 0 not in use.

Disconnecting from device...
Saving result file...

Uploading and Viewing Results in Test Space

Optionally, if you have Internet connectivity and access to your company's Test Space[2] you could run again the TestIntro tests and upload the results by executing:

stride --database=<path>/stride.sidb --device=<device_address> -u --testspace=<user>:<pwd>@<mycompany>.stridetestspace.com --project="Stride Deployment" --space=TestIntro --run="*"
TestIntro Test Space Page

Open your web browser, login to your company's test space site if needed and navigate to the All Projects page.

You should now see the TestIntro test space listed under the Stride Deployment project, and see that TestIntro's Result Set Count is now 1.

Click on the TestIntro link to be presented with the TestIntro space page. At the bottom of the page you will see a table displaying the uploaded result sets for this test space. Click on the Sequence_1 link to show detailed results for this test run.

Notes

  1. The TestIntro sample is distributed in the Samples package.
  2. You need to have an account with access to a dedicated "Stride Deployment" project and "TestIntro" space created by your Test Space administrator