CDash:Testing: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
CDash integrates a self-testing framework based on [http://www.simpletest.org Simple Test]. The self testing code is located in the ''CDash/testing'' directory. | CDash integrates a self-testing framework based on [http://www.simpletest.org Simple Test]. The self testing code is located in the ''CDash/testing'' directory. | ||
CDash testing requires the use of CMake and CTest. You can download the CMake suite of tools from [http://www.cmake.org/cmake/resources/software.html www.cmake.org]. CDash testing works much the same as any other CMake based project. | |||
= Checkout the CDash source code = | |||
See [[CDash:Installation#Downloading_CDash|Downloading CDash]] for instructions on obtaining a copy of the CDash source code from subversion. During this step you should decide whether you want to test the latest release of CDash or the current development version. | |||
CDash | |||
No matter which version of CDash you choose to test, make sure to check out the source code into your web server's htdocs folder. | |||
= Setup CDash for testing = | |||
== Create a build directory == | |||
cd /path/to/CDashTesting | |||
mkdir build | |||
==Run CMake from the build directory == | |||
cd build | |||
cmake .. | |||
== Define CMake variables == | |||
* | CDASH_DB_HOST | ||
CDASH_DB_LOGIN | |||
CDASH_DB_PASS | |||
CDASH_DB_TYPE | |||
*These four parameters tell CDash how to connect to your local database server. | |||
* | CDASH_SERVER | ||
*CDASH_SERVER should indicate how to connect to your local system via a web browser. This is typically the system's host name, or simply localhost. | |||
CDASH_USE_APACHE2 | |||
*Setting this to ON will enable tests specific to the Apache web server. | |||
* | CDASH_USE_SELENIUM | ||
PHPUNIT_EXE | |||
*Setting these options will enable testing of javascript based functionality of CDash. Requires [http://seleniumhq.org/ selenium] and [http://www.phpunit.de/ PHPUnit]. More on this below. | |||
* | CMake_SOURCE_DIR | ||
*Point this to a local checkout of CMake source code if you'd like to import some tests from CMake into CDash. This will cause CDash to perform a more thorough end-to-end test of the CMake/CTest/CDash suite of tools. | |||
PHP_EXE | |||
*CDash testing requires a command-line version of PHP to be installed on the system. | |||
= Test CDash = | |||
This is as simple as entering your CDash build directory and running CTest | |||
cd /path/to/CDashTesting/build | |||
ctest -VV | |||
Note this will create '''CDashTesting/cdash/config.local.php''' and '''CDashTesting/testing/config.test.local.php''' files in your source tree, so svn will show them as ? files. | |||
= Advanced Topics = | |||
[[CDash:Testing/Coverage|Code coverage]] | |||
[[CDash:Testing/Selenium|Testing javascript functionality with Selenium]] | |||
[[CDash:Testing/Client Management|Client management]] | |||
[[CDash:Testing/Nightly|Setting up nightly Builds]] | |||
Revision as of 18:27, 25 June 2010
CDash integrates a self-testing framework based on Simple Test. The self testing code is located in the CDash/testing directory.
CDash testing requires the use of CMake and CTest. You can download the CMake suite of tools from www.cmake.org. CDash testing works much the same as any other CMake based project.
Checkout the CDash source code
See Downloading CDash for instructions on obtaining a copy of the CDash source code from subversion. During this step you should decide whether you want to test the latest release of CDash or the current development version.
No matter which version of CDash you choose to test, make sure to check out the source code into your web server's htdocs folder.
Setup CDash for testing
Create a build directory
cd /path/to/CDashTesting mkdir build
Run CMake from the build directory
cd build cmake ..
Define CMake variables
CDASH_DB_HOST CDASH_DB_LOGIN CDASH_DB_PASS CDASH_DB_TYPE
- These four parameters tell CDash how to connect to your local database server.
CDASH_SERVER
- CDASH_SERVER should indicate how to connect to your local system via a web browser. This is typically the system's host name, or simply localhost.
CDASH_USE_APACHE2
- Setting this to ON will enable tests specific to the Apache web server.
CDASH_USE_SELENIUM PHPUNIT_EXE
- Setting these options will enable testing of javascript based functionality of CDash. Requires selenium and PHPUnit. More on this below.
CMake_SOURCE_DIR
- Point this to a local checkout of CMake source code if you'd like to import some tests from CMake into CDash. This will cause CDash to perform a more thorough end-to-end test of the CMake/CTest/CDash suite of tools.
PHP_EXE
- CDash testing requires a command-line version of PHP to be installed on the system.
Test CDash
This is as simple as entering your CDash build directory and running CTest
cd /path/to/CDashTesting/build ctest -VV
Note this will create CDashTesting/cdash/config.local.php and CDashTesting/testing/config.test.local.php files in your source tree, so svn will show them as ? files.