@@ -1024,11 +1024,24 @@ function lime_shutdown()
10241024 ob_end_clean ();
10251025 unlink ($ test_file );
10261026
1027+ $ stats ['status_code ' ] = $ return ;
10271028 $ output = file_get_contents ($ result_file );
10281029 $ stats ['output ' ] = $ output ? unserialize ($ output ) : '' ;
1029- if (!$ stats ['output ' ])
1030- {
1031- $ stats ['output ' ] = array (array ('file ' => $ file , 'tests ' => array (), 'stats ' => array ('plan ' => 1 , 'total ' => 1 , 'failed ' => array (0 ), 'passed ' => array (), 'skipped ' => array (), 'errors ' => array ())));
1030+ if (!$ stats ['output ' ]) {
1031+ $ stats ['output ' ] = array (
1032+ array (
1033+ 'file ' => $ file ,
1034+ 'tests ' => array (),
1035+ 'stats ' => array (
1036+ 'plan ' => 1 ,
1037+ 'total ' => 1 ,
1038+ 'failed ' => array (0 ),
1039+ 'passed ' => array (),
1040+ 'skipped ' => array (),
1041+ 'errors ' => array (),
1042+ ),
1043+ ),
1044+ );
10321045 }
10331046 unlink ($ result_file );
10341047
@@ -1037,23 +1050,10 @@ function lime_shutdown()
10371050
10381051 $ delta = $ this ->computePlanDeltaFromFileStats ($ file_stats );
10391052
1040- if ($ return > 0 )
1041- {
1053+ if (0 === $ stats ['status_code ' ]) {
1054+ $ stats ['status ' ] = 'ok ' ;
1055+ } else {
10421056 $ stats ['status ' ] = $ file_stats ['failed ' ] ? 'not ok ' : ($ file_stats ['errors ' ] ? 'errors ' : 'dubious ' );
1043- $ stats ['status_code ' ] = $ return ;
1044- }
1045- else
1046- {
1047- if (0 != $ delta )
1048- {
1049- $ stats ['status ' ] = $ file_stats ['errors ' ] ? 'errors ' : 'dubious ' ;
1050- $ stats ['status_code ' ] = 255 ;
1051- }
1052- else
1053- {
1054- $ stats ['status ' ] = $ file_stats ['errors ' ] ? 'errors ' : 'ok ' ;
1055- $ stats ['status_code ' ] = 0 ;
1056- }
10571057 }
10581058
10591059 if (true === $ this ->full_output )
@@ -1125,7 +1125,15 @@ function lime_shutdown()
11251125
11261126 if (isset ($ stat ['output ' ][0 ]))
11271127 {
1128- $ this ->output ->echoln (sprintf ($ format , substr ($ relative_file , -min (30 , strlen ($ relative_file ))), $ stat ['status_code ' ], count ($ stat ['output ' ][0 ]['stats ' ]['failed ' ]) + count ($ stat ['output ' ][0 ]['stats ' ]['passed ' ]), count ($ stat ['output ' ][0 ]['stats ' ]['failed ' ]), count ($ stat ['output ' ][0 ]['stats ' ]['errors ' ]), implode (' ' , $ stat ['output ' ][0 ]['stats ' ]['failed ' ])));
1128+ $ this ->output ->echoln (sprintf ($ format ,
1129+ substr ($ relative_file , -min (30 , strlen ($ relative_file ))),
1130+ $ stat ['status_code ' ],
1131+ count ($ stat ['output ' ][0 ]['stats ' ]['failed ' ])
1132+ + count ($ stat ['output ' ][0 ]['stats ' ]['passed ' ]),
1133+ count ($ stat ['output ' ][0 ]['stats ' ]['failed ' ]),
1134+ count ($ stat ['output ' ][0 ]['stats ' ]['errors ' ]),
1135+ implode (' ' , $ stat ['output ' ][0 ]['stats ' ]['failed ' ])
1136+ ));
11291137 }
11301138 else
11311139 {
0 commit comments