Simplify test output

Esse commit está contido em:
Andrei Alexandrescu
2013-04-25 21:59:15 -07:00
commit de Sara Golemon
commit e434a1872d
2 arquivos alterados com 17 adições e 10 exclusões
+9 -6
Ver Arquivo
@@ -142,7 +142,8 @@ if (!$opt_threads) {
(
"--------------------------------------------------------------------------\n",
"Test c_user c_system c_total chng\n",
" passed/FAILED h_user h_system h_total %% chng\n"
" passed/FAILED h_user h_system h_total %% chng\n",
"--------------------------------------------------------------------------\n",
);
if (!$opt_quiet)
@@ -206,7 +207,6 @@ foreach $test (@ARGV)
my (@TSTATS);
my ($t_str);
@TSTATS = ("--------------------------------------------------------------------------\n");
$t_str = sprintf ("%s%s", $test, ' ' x (40 - length($test)));
@TSTATS = (@TSTATS, $t_str);
@@ -665,12 +665,15 @@ sub print_stats
my (@TSTATS);
my ($t_str, $pass_str);
$pass_str = $okay ? "passed" : "*** FAILED ***";
$pass_str = $okay ? "" : "*** FAILED ***";
if ((0 != $subtests) && (!$okay))
{
$pass_str = $pass_str . " ($failed_subtests/$subtests failed)";
}
$pass_str = $pass_str . ' ' x (39 - length($pass_str));
if (length($pass_str) > 0)
{
$pass_str = $pass_str . ' ' x (39 - length($pass_str));
}
if (-r "$test.perf")
{
@@ -700,9 +703,9 @@ sub print_stats
$hstime = 0.0;
$t_str = sprintf (" %7.2f %7.2f %7.2f \n"
. " %s\n",
. "%s",
$utime, $stime, $utime + $stime,
$pass_str);
length($pass_str) > 0 ? " $pass_str\n" : "");
}
@TSTATS = ($t_str);
if (!$opt_quiet)
+8 -4
Ver Arquivo
@@ -18,13 +18,17 @@ if (count($argv) != 6) {
$cmd = "FBMAKE_BIN_ROOT=$argv[5] $argv[1] $argv[2] -m $argv[3] $argv[4]";
loop_tests($cmd, function ($line) {
if (preg_match('/^(?:hphp\/)?(test[^\s]*).*/', $line, &$m)) {
if (test_is_running()) {
// Previous test made it! Just needs finishing.
finish('passed');
}
start($m[1]);
return;
}
if (!test_is_running()) return;
if (preg_match('/^\s*passed.*/', $line)) {
finish('passed');
} else if (preg_match('/^[\s\*]*FAILED.*/', $line)) {
if (preg_match('/^[\s\*]*FAILED.*/', $line)) {
finish('failed');
} else if (preg_match('/^\s*Totals.*/', $line) && test_is_running()) {
// Account for last test if it was successful
finish('passed');
}
});