Commit 457da7bf authored by Torsten Zühlsdorff's avatar Torsten Zühlsdorff
Browse files
parents 2193d342 9b0d4b8c
......@@ -27,7 +27,4 @@ deploying:
tags:
- rsync
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- rsync -rpvu --progress ./aphpunit-*.phar $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH
- killall ssh-agent
- rsync -rpvu --progress ./aphpunit-*.phar $DEPLOY_HOST:$DEPLOY_PATH
1.4
===
- Feature: Remove source-path of test-cases to make Testcase-Summary more readable
1.3
===
- Feature: Display line in which exception was thrown
......
......@@ -155,7 +155,7 @@ $objQueue->close();
/* print the result */
/********************/
$arrGlobalSummary = Testresults\display($arrTestResults);
$arrGlobalSummary = Testresults\display($arrTestResults, $strTestSource);
if(0 < $arrGlobalSummary['failed'])
exitWithCodeAndMessage(2, 'APHPUnit detected errors');
......@@ -51,5 +51,6 @@ require_once __DIR__ . '/inc/Fork.class.php';
/********************************/
require_once __DIR__ . '/inc/test-results/display.func.php';
require_once __DIR__ . '/inc/test-results/getFilePathWithoutSource.func.php';
require_once __DIR__ . '/inc/test-results/getSummary.func.php';
require_once __DIR__ . '/inc/test-results/sortTestCasesByLine.func.php';
\ No newline at end of file
require_once __DIR__ . '/inc/test-results/sortTestCasesByLine.func.php';
......@@ -4,11 +4,12 @@ namespace APHPUnit\Testresults;
/**
* @param $arrTestResults - list of all test-results
* @param $strTestSource - the source-path of tests given
*
* display the results of all tests, including
* everything fine and everything failed
**/
function display($arrTestResults) {
function display($arrTestResults, $strTestSource) {
$arrGlobalSummary = array('test-cases' => 0, 'success' => 0, 'failed' => 0);
$arrFileSummary = array();
......@@ -19,8 +20,10 @@ function display($arrTestResults) {
print "\nTestcase-Summary\n================\n\n";
foreach($arrFileSummary AS $strFile => $arrSummary)
foreach($arrFileSummary AS $strFile => $arrSummary) {
$strFile = getFilePathWithoutSource($strFile, $strTestSource);
print "$strFile:\t {$arrSummary['success']}/{$arrSummary['test-cases']} successfull\n";
}
print "\n{$arrGlobalSummary['success']} from {$arrGlobalSummary['test-cases']} successfull, {$arrGlobalSummary['failed']} failures reported\n";
......@@ -31,8 +34,10 @@ function display($arrTestResults) {
foreach($arrFailedCases AS $arrCase) {
if(!empty($arrCase['file']))
print "File:\t{$arrCase['file']}\n";
if(!empty($arrCase['file'])) {
$strFile = getFilePathWithoutSource($arrCase['file'], $strTestSource);
print "File:\t$strFile\n";
}
if(!empty($arrCase['line']))
print "Line:\t{$arrCase['line']}\n";
......
<?php
namespace APHPUnit\Testresults;
/**
* @param $strFilePath - path of file to remove source from
* @param $strSource - the source-path to remove
*
* @returns (string) file path without given source
*
* removes the given source-path to test-cases from the given
* file-path.
*
* example:
* if there is a file "ExampleTest.php" in directory "tests/"
* a call to:
* $ aphpunit tests/
* will result in:
* ExampleTest.php
**/
function getFilePathWithoutSource($strFilePath, $strSource) {
$intPathLengthSource = mb_strlen($strSource);
return mb_substr($strFilePath, $intPathLengthSource);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment