cvs: php-gcov-web /cron compile_results.php test_cc_regex.php
| From: | Nuno Lopes | Date: | Fri, 29 Dec 2006 20:25:33 +0000 |
| Subject: | cvs: php-gcov-web /cron compile_results.php test_cc_regex.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-33627@lists.php.net to get a copy of this message | ||
nlopess Fri Dec 29 20:25:33 2006 UTC
Modified files:
/php-gcov-web/cron compile_results.php test_cc_regex.php
Log:
improve gcc regex to handle other sections than .text (like .data)
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/compile_results.php?r1=1.6&r2=1.7&diff_format=u
Index: php-gcov-web/cron/compile_results.php
diff -u php-gcov-web/cron/compile_results.php:1.6 php-gcov-web/cron/compile_results.php:1.7
--- php-gcov-web/cron/compile_results.php:1.6 Sun Dec 24 17:19:17 2006
+++ php-gcov-web/cron/compile_results.php Fri Dec 29 20:25:33 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: compile_results.php,v 1.6 2006/12/24 17:19:17 nlopess Exp $ */
+/* $Id: compile_results.php,v 1.7 2006/12/29 20:25:33 nlopess Exp $ */
// Compile Results generation script
@@ -32,7 +32,7 @@
// Regular expression to select the error and warning information
// tuned for gcc 3.4, 4.0 and 4.1
-$gcc_regex = '/^((.+)(\(\.text\+0x[[:xdigit:]]+\))?: In function
[`\'](\w+)\':\s+)?'.
+$gcc_regex = '/^((.+)(\(\.[a-z]+\+0x[[:xdigit:]]+\))?: In function
[`\'](\w+)\':\s+)?'.
'((?(1)(?(3)[^:\n]+|\2)|[^:\n]+)):(\d+): (?:(error|warning):\s+)?(.+)'.
str_repeat('(?:\s+\5:(\d+): (?:(error|warning):\s+)?(.+))?', 99). // capture up to 100
errors
'/mS';
http://cvs.php.net/viewvc.cgi/php-gcov-web/cron/test_cc_regex.php?r1=1.2&r2=1.3&diff_format=u
Index: php-gcov-web/cron/test_cc_regex.php
diff -u php-gcov-web/cron/test_cc_regex.php:1.2 php-gcov-web/cron/test_cc_regex.php:1.3
--- php-gcov-web/cron/test_cc_regex.php:1.2 Tue Dec 19 21:42:16 2006
+++ php-gcov-web/cron/test_cc_regex.php Fri Dec 29 20:25:33 2006
@@ -3,6 +3,8 @@
// use it to test the gcc regex with the sample data provided
$sampledata = "
+main/main.o(.data+0x948): In function `php_verror':
+/p2/var/php_gcov/PHP_4_4/main/main.c:467: undefined reference to `OnUpdateLongGEZero'
/p2/var/php_gcov/PHP_4_4/ext/ming/ming.c: In function `zif_swfbitmap_init':
/p2/var/php_gcov/PHP_4_4/ext/ming/ming.c:323: warning: assignment from incompatible pointer type
/p2/var/php_gcov/PHP_4_4/ext/ming/ming.c: In function `zif_swftextfield_setFont':
@@ -60,12 +62,12 @@
/p2/var/php_gcov/PHP_5_2/ext/ming/ming.c:154: undefined reference to `Ming_setSWFCompression'
";
- // Regular expression to select the error and warning information
- // tuned for gcc 3.4, 4.0 and 4.1
- $gcc_regex = '/^((.+)(\(\.text\+0x[[:xdigit:]]+\))?: In function
[`\'](\w+)\':\s+)?'.
- '((?(1)(?(3)[^:\n]+|\2)|[^:\n]+)):(\d+): (?:(error|warning):\s+)?(.+)'.
- str_repeat('(?:\s+\5:(\d+): (?:(error|warning):\s+)?(.+))?', 99). // capture up to 100
errors
- '/mS';
+// Regular expression to select the error and warning information
+// tuned for gcc 3.4, 4.0 and 4.1
+$gcc_regex = '/^((.+)(\(\.[a-z]+\+0x[[:xdigit:]]+\))?: In function
[`\'](\w+)\':\s+)?'.
+ '((?(1)(?(3)[^:\n]+|\2)|[^:\n]+)):(\d+): (?:(error|warning):\s+)?(.+)'.
+ str_repeat('(?:\s+\5:(\d+): (?:(error|warning):\s+)?(.+))?', 99). // capture up to 100
errors
+ '/mS';
var_dump(preg_match_all($gcc_regex, $sampledata, $m, PREG_SET_ORDER));