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()
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()
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.
void |
public function mapPathsToResults($paths)
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)
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)
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()
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)
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.
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)
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($coverage)
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).
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)
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. |