Skip to content

Commit 03f15f7

Browse files
committed
add ability to show valgrind output with --show-mem
1 parent c29f1f4 commit 03f15f7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

run-tests.php

100755100644
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ function save_or_mail_results()
497497
$slow_min_ms = INF;
498498

499499
$cfgtypes = array('show', 'keep');
500-
$cfgfiles = array('skip', 'php', 'clean', 'out', 'diff', 'exp');
500+
$cfgfiles = array('skip', 'php', 'clean', 'out', 'diff', 'exp', 'mem');
501501
$cfg = array();
502502

503503
foreach($cfgtypes as $type) {
@@ -860,7 +860,7 @@ function save_or_mail_results()
860860

861861
junit_save_xml();
862862

863-
if (getenv('REPORT_EXIT_STATUS') == 1 && ($sum_results['FAILED'] || $sum_results['BORKED'])) {
863+
if (getenv('REPORT_EXIT_STATUS') == 1 && ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['LEAKED'])) {
864864
exit(1);
865865
}
866866

@@ -997,8 +997,7 @@ function test_sort($a, $b)
997997
save_or_mail_results();
998998

999999
junit_save_xml();
1000-
1001-
if (getenv('REPORT_EXIT_STATUS') == 1 && ($sum_results['FAILED'] || $sum_results['BORKED'])) {
1000+
if (getenv('REPORT_EXIT_STATUS') == 1 && ($sum_results['FAILED'] || $sum_results['LEAK'] || $sum_results['LEAKED'])) {
10021001
exit(1);
10031002
}
10041003
exit(0);
@@ -2215,6 +2214,10 @@ function run_test($php, $file, $env)
22152214
error_report($file, $log_filename, $tested);
22162215
}
22172216
}
2217+
2218+
if ($valgrind && $leaked && $cfg["show"]["mem"]) {
2219+
show_file_block('mem', file_get_contents($memcheck_filename));
2220+
}
22182221

22192222
show_result(implode('&', $restype), $tested, $tested_file, $info, $temp_filenames);
22202223

0 commit comments

Comments
 (0)