{{{ #!html
}}} = Automated Testing = '''Table of Contents''' [[PageOutline(2-3,,inline)]] PJSIP has been equipped with an automated testing script (called test scenarios) since version 1.6. This article explains what it is and how to configure it. [[BR]] == Introduction == The automated testing framework automatically and continuously updates, configures, builds, and performs various unit tests on PJSIP distribution, and submit the result to [http://my.cdash.org/index.php?project=PJSIP PJSIP's CDash] test dashboard. The scenario uses [http://trac2.pjsip.org/ccdash CCDash] (client for CDash; note the extra "c") framework to automate the tasks. Supported targets: - [wiki:Getting-Started/Autoconf GNU/Makefile] desktop based (Linux, Mac OS X, etc.) - [wiki:Getting-Started/Windows Windows] or Visual Studio including [wiki:Getting-Started/Windows-Mobile Windows Mobile] - [wiki:Getting-Started/Symbian Symbian S60] (with/without [wiki:APS]/[wiki:VAS]) - [wiki:Getting-Started/iPhone iPhone/iPad] [[BR]] == Installation == 1. Checkout PJSIP source code from SVN 1. Download and install [http://trac2.pjsip.org/ccdash CCDash] (click the link for the info) 1. Download and install any features to be used/tested, e.g. Intel IPP, Symbian APS/VAS plugin, etc. [[BR]] == Configuring and Running Test Scenarios == The general steps to configure automated test script on a platform are as follows: 0. Go to directory '''{{{tests/automated}}}''' inside pjsip distribution. 1. Choose the appropriate scenario ''template'' for your target/test objective. A template is an XML file containing ccdash commands to perform automated tests for a particular target. The PJSIP distribution have been equipped with the following templates: || '''Target platform ''' || '''Template file name ''' || '''Description ''' || '''Requirements ''' || || Makefile based (Linux, Mac OS X) || {{{gnu.xml.template}}} || Default settings || - || || Linux, Mac OS X with IPP || {{{gnu-ipp.xml.template}}} || Intel IPP || [wiki:Intel_IPP_Codecs Intel IPP and samples] || || MSVC/Win32 inc. WM || {{{msvc.xml.template}}} || Default settings || - || || Symbian/S60 3rd Ed|| {{{symbian.xml.template}}} || Default settings || - || || Symbian/S60 3rd Ed || {{{symbian-aps.xml.template}}} || Nokia APS and APS-Direct || [wiki:APS Nokia APS plugin] || || Symbian/S60 3rd Ed || {{{symbian-vas.xml.template}}} || Nokia VAS and VAS-Direct || [wiki:VAS Nokia VAS plugin] || || iPhone || {{{iphone.xml.template}}} || iPhoneOS || one iPhone SDK must be installed || 2. From the template, you will then create the actual scenario file by running '''{{{configure.py}}}'''. This is needed to ''instantiate'' the template using configurations that are specific to your host. Sample session: {{{ $ cd tests/automated $ ./configure.py scenario.xml.template -o scenario.xml }}} The above command will produce '''{{{scenario.xml}}}''' scenario file. 3. For testing, run the scenario by running: {{{ $ ./run_scenario.py scenario.xml }}} This will perform the automated tests and submit the result under "Experimental" group on CDash. Depending on which test is being run, it may take between two minutes to two hours to complete. You may press Ctrl-C to stop the execution. 4. Once you're satisfied that the scenario(s) will work correctly, run '''{{{run_continuous.py}}}''' to perform both "Continuous" and "Nightly" builds on the specified scenario(s): {{{ $ ./run_continuous.py scenario1.xml [scenario2.xml ...] }}} The script will run the automated tests in the scenario(s) everytime changes occur in the repository, or at every 00:00:00 GMT for the "Nightly" build. 5. Go to [http://my.cdash.org/index.php?project=PJSIP PJSIP's CDash] test dashboard to check the test results. Note that test results are only submitted once all tests in a scenario are completed. 6. Now the automated test will run everytime there is a new checkin in the repository, or at every 00:00:00 GMT for the "Nightly" build. [[BR]] == The Templates == The detailed steps to configure each template will be explained below. [[BR]] === gnu.xml.template === This configures, build, and tests with default settings. To perform this test: {{{ $ ./configure.py -t gnu -o gnu.xml gnu.xml.template $ ./run_scenario.py gnu.xml }}} [[BR]] === gnu-ipp.xml.template === Template for testing IPP. Requirements: - [wiki:Intel_IPP_Codecs Intel IPP and samples] - Environment variables: - IPPROOT - IPPSAMPLES - IPPARCH (optional) - IPP path added to LD_LIBRARY_PATH Sample session: {{{ $ export IPPROOT=/opt/intel/ipp/6.1.2.051/em64t/ $ export IPPSAMPLES=/home/bennylp/Desktop/opt/ipp-samples $ (optional) export IPPARCH=em64t $ export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/opt/intel/ipp/6.1.2.051/em64t/sharedlib' $ ./configure.py -t gnu -o gnu-ipp.xml gnu-ipp.xml.template $ ./run_scenario.py gnu-ipp.xml }}} [[BR]] === iphone.xml.template === Template for testing [wiki:Getting-Started/iPhone iPhone]. Requirement(s): - on Mac OS X - at least one iPhone SDK must be installed Sample session: {{{ $ ./configure.py -o iphone.xml iphone.xml.template $ ./run_scenario.py iphone.xml }}} Note: - currently there's no way to select which iPhone SDK to use, as the {{{configure.py}}} automatically picks up the latest version of SDK installed. [[BR]] === msvc.xml.template === Visual Studio targets. TBD. [[BR]] === symbian.xml.template === Symbian S60 targets. TBD. [[BR]] === symbian-aps.xml.template === Symbian S60 with APS target. TBD. [[BR]] === symbian-vas.xml.template === Symbian S60 with VAS target. TBD. {{{ #!html
}}}