mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-26 00:32:41 +01:00
aebcd7a985
Summary: Many test frameworks can format their output in xUnit-like format. Test Plan: Tested the Nose engine with a Nose one, and the pytest with a demo project. Reviewers: epriestley Reviewed By: epriestley CC: Korvin, aran Differential Revision: https://secure.phabricator.com/D7011 Conflicts: src/__phutil_library_map__.php
23 lines
530 B
PHP
23 lines
530 B
PHP
<?php
|
|
|
|
/**
|
|
* Very basic 'py.test' unit test engine wrapper.
|
|
*
|
|
* @group unitrun
|
|
*/
|
|
final class PytestTestEngine extends ArcanistBaseUnitTestEngine {
|
|
|
|
public function run() {
|
|
$junit_tmp = new TempFile();
|
|
|
|
$cmd_line = csprintf('py.test --junitxml=%s',
|
|
$junit_tmp);
|
|
$future = new ExecFuture('%C', $cmd_line);
|
|
list($stdout, $stderr) = $future->resolvex();
|
|
|
|
$parser = new ArcanistXUnitTestResultParser();
|
|
|
|
return $parser->parseTestResults(Filesystem::readFile($junit_tmp));
|
|
}
|
|
|
|
}
|