public function __get($name)Inherited
$name |
wild |
public function __set($name, $value)Inherited
$name | ||
$value |
wild |
public function current()Inherited
wild |
public function key()Inherited
wild |
public function next()Inherited
wild |
public function rewind()Inherited
wild |
public function valid()Inherited
wild |
private function throwOnAttemptedIteration()Inherited
wild |
public function getPhobjectClassConstant($key, $byte_limit)Inherited
Read the value of a class constant.
This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.
string | $key | Name of the constant. |
int|null | $byte_limit | Maximum number of bytes permitted in the value. |
string | Value of the constant. |
final public function __construct()Inherited
this | //Implicit.// |
public function getEngineConfigurationName()Inherited
wild |
final public function setRunAllTests($run_all_tests)Inherited
$run_all_tests |
wild |
final public function getRunAllTests()Inherited
wild |
protected function supportsRunAllTests()Inherited
This test engine supports running all tests.
wild |
final public function setConfigurationManager($configuration_manager)Inherited
ArcanistConfigurationManager | $configuration_manager |
wild |
final public function getConfigurationManager()Inherited
wild |
final public function setWorkingCopy($working_copy)Inherited
ArcanistWorkingCopyIdentity | $working_copy |
wild |
final public function getWorkingCopy()Inherited
wild |
final public function setPaths($paths)Inherited
array | $paths |
wild |
final public function getPaths()Inherited
wild |
final public function setEnableCoverage($enable_coverage)Inherited
$enable_coverage |
wild |
final public function getEnableCoverage()Inherited
wild |
final public function setRenderer($renderer)Inherited
ArcanistUnitRenderer | $renderer |
wild |
public function run()Inherited
Main entry point for the test engine. Determines what assemblies to build and test based on the files that have changed.
array | Array of test results. |
public function shouldEchoTestResults()Inherited
Modify the return value of this function in the child class, if you do not need to echo the test results after all the tests have been run. This is the case for example when the child class prints the tests results while the tests are running.
wild |
protected function loadEnvironment()
Determines what executables and test paths to use. Between platforms this also changes whether the test engine is run under .NET or Mono. It also ensures that all of the required binaries are available for the tests to run successfully.
Overridden version of loadEnvironment to support a different set of configuration values and to pull in the cstools config for code coverage.
void |
public function mapPathsToResults($paths)Inherited
Applies the discovery rules to the set of paths specified.
array | $paths | Array of paths. |
array | Array of paths to test projects and assemblies. |
public function runAllTests($test_projects)Inherited
Builds and runs the specified test assemblies.
array | $test_projects | Array of paths to test project files. |
array | Array of test results. |
private function resultsContainFailures($results)Inherited
Determine whether or not a current set of results contains any failures. This is needed since we build the assemblies as part of the unit tests, but we can't run any of the unit tests if the build fails.
array | $results | Array of results to check. |
bool | If there are any failures in the results. |
private function generateProjects()Inherited
If the Build directory exists, we assume that this is a multi-platform project that requires generation of C# project files. Because we want to test that the generation and subsequent build is whole, we need to regenerate any projects in case the developer has added files through an IDE and then forgotten to add them to the respective .definitions file. By regenerating the projects we ensure that any missing definition entries will cause the build to fail.
array | Array of test results. |
private function buildProjects($test_assemblies)Inherited
Build the projects relevant for the specified test assemblies and return the results of the builds as test results. This build also passes the "SkipTestsOnBuild" parameter when building the projects, so that MSBuild conditionals can be used to prevent any tests running as part of the build itself (since the unit tester is about to run each of the tests individually).
array | $test_assemblies | Array of test assemblies. |
array | Array of test results. |
protected function buildTestFuture($test_assembly)
Build the future for running a unit test. This can be overridden to enable support for code coverage via another tool.
Overridden version of buildTestFuture so that the unit test can be run via cscover, which instruments assemblies and reports on code coverage.
string | $test_assembly | Name of the test assembly. |
array | The future, output filename and coverage filename stored in an array. |
private function testAssemblies($test_assemblies)Inherited
Run the xUnit test runner on each of the assemblies and parse the resulting XML.
array | $test_assemblies | Array of test assemblies. |
array | Array of test results. |
protected function parseCoverageResult($cover_file)
Returns null for this implementation as xUnit does not support code coverage directly. Override this method in another class to provide code coverage information (also see CSharpToolsUnitEngine).
Returns coverage results for the unit tests.
string | $coverage | The name of the coverage file if one was provided by `buildTestFuture`. |
array | Code coverage results, or null. |
private function parseTestResult($xunit_tmp, $coverage)Inherited
Parses the test results from xUnit.
string | $xunit_tmp | The name of the xUnit results file. |
string | $coverage | The name of the coverage file if one was provided by `buildTestFuture`. This is passed through to `parseCoverageResult`. |
array | Test results. |
private function assemblyShouldBeInstrumented($file)
Returns whether the specified assembly should be instrumented for code coverage reporting. Checks the excluded file list and the matching regex if they are configured.
$file |
boolean | Whether the assembly should be instrumented. |
private function getCachedResultsIfPossible($cover_file)
Retrieves the cached results for a coverage result file. The coverage result file is XML and can be large depending on what has been instrumented so we cache it in case it's requested again.
string | $cover_file | The name of the coverage file. |
array | Code coverage results, or null if not cached. |
private function addCachedResults($cover_file, $results)
Stores the code coverage results in the cache.
string | $cover_file | The name of the coverage file. |
array | $results | The results to cache. |
wild |
private function processTags($tags)
Processes a set of XML tags as code coverage results. We parse the instrumented and executed tags with this method so that we can access the data multiple times without a performance hit.
array | $tags | The array of XML tags to parse. |
array | A PHP array containing the data. |
public function readCoverage($cover_file)
Reads the code coverage results from the cscover results file.
string | $cover_file | The path to the code coverage file. |
array | The code coverage results. |