Changeset 4246
- Timestamp:
- 06/18/07 21:42:37 (1 year ago)
- Files:
-
- tools/lime/trunk/lib/lime.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/lime/trunk/lib/lime.php
r4245 r4246 42 42 if ($total > $this->plan) 43 43 { 44 $this->output-> diag(sprintf("Looks like you planned %d tests but ran %d extra.", $this->plan, $total - $this->plan));44 $this->output->red_bar(sprintf(" Looks like you planned %d tests but ran %d extra.", $this->plan, $total - $this->plan)); 45 45 } 46 46 elseif ($total < $this->plan) 47 47 { 48 $this->output-> diag(sprintf("Looks like you planned %d tests but only ran %d.", $this->plan, $total));48 $this->output->red_bar(sprintf(" Looks like you planned %d tests but only ran %d.", $this->plan, $total)); 49 49 } 50 50 51 51 if ($this->failed) 52 52 { 53 $this->output->diag(sprintf("Looks like you failed %d tests of %d.", $this->failed, $this->plan)); 53 $this->output->red_bar(sprintf(" Looks like you failed %d tests of %d.", $this->failed, $this->plan)); 54 } 55 else 56 { 57 $this->output->green_bar(" Looks like everything went fine."); 54 58 } 55 59 … … 306 310 307 311 function echoln($message) 312 { 313 echo "$message\n"; 314 } 315 316 function green_bar($message) 317 { 318 echo "$message\n"; 319 } 320 321 function red_bar($message) 308 322 { 309 323 echo "$message\n"; … … 343 357 echo ($colorizer_parameter ? $this->colorizer->colorize($message, $colorizer_parameter) : $message)."\n"; 344 358 } 359 360 function green_bar($message) 361 { 362 echo $this->colorizer->colorize($message.str_repeat(' ', 71 - min(71, strlen($message))), 'GREEN_BAR')."\n"; 363 } 364 365 function red_bar($message) 366 { 367 echo $this->colorizer->colorize($message.str_repeat(' ', 71 - min(71, strlen($message))), 'RED_BAR')."\n"; 368 } 345 369 } 346 370 … … 384 408 lime_colorizer::style('PARAMETER', array('fg' => 'cyan')); 385 409 lime_colorizer::style('COMMENT', array('fg' => 'yellow')); 410 411 lime_colorizer::style('GREEN_BAR', array('fg' => 'white', 'bg' => 'green', 'bold' => true)); 412 lime_colorizer::style('RED_BAR', array('fg' => 'white', 'bg' => 'red', 'bold' => true)); 386 413 387 414 class lime_harness extends lime_registration … … 522 549 } 523 550 524 $this->output-> echoln(sprintf('Failed %d/%d test scripts, %.2f%% okay. %d/%d subtests failed, %.2f%% okay.',551 $this->output->red_bar(sprintf('Failed %d/%d test scripts, %.2f%% okay. %d/%d subtests failed, %.2f%% okay.', 525 552 $nb_failed_files = count($this->stats['_failed_files']), 526 553 $nb_files = count($this->files), … … 529 556 $nb_tests = $this->stats['_nb_tests'], 530 557 $nb_tests > 0 ? ($nb_tests - $nb_failed_tests) * 100 / $nb_tests : 0 531 ) , 'ERROR');558 )); 532 559 } 533 560 else 534 561 { 535 $this->output-> echoln('All tests successful.', 'INFO');536 $this->output-> echoln(sprintf('Files=%d, Tests=%d', count($this->files), $this->stats['_nb_tests']), 'INFO');562 $this->output->green_bar(' All tests successful.'); 563 $this->output->green_bar(sprintf(' Files=%d, Tests=%d', count($this->files), $this->stats['_nb_tests'])); 537 564 } 538 565