Commit: b5ca40eae532d0bafd1a62808e8b887bc9f687cc Author: Peter Kokot <peterko...@gmail.com> Wed, 17 Oct 2018 08:22:48 +0200 Parents: 7276801013f34d93e8fd8d51f65f2ad8f45f2e49 Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=b5ca40eae532d0bafd1a62808e8b887bc9f687cc Log: Trim trailing whitespace Changed paths: M api.php M autogenerate.php M buildtest-action.php M buildtest-process.php M expectf_details.php M handling-bugs.php M howtohelp.php M include/functions.php M include/release-qa.php M index.php M pftt.php M pftt_report.php M projects.php M pulls/Markdown.Converter.js M pulls/Markdown.Sanitizer.js M pulls/api.php M pulls/jquery-ui.css M pulls/jquery.ba-bbq.min.js M pulls/jsrender.js M pulls/pullrequests.js M regtests/README M regtests/maketests M regtests/runtests M regtests/test/suite/bin/test_class_inheritance.php M regtests/test/suite/bin/testscanf.php M reports/README M reports/convert.php M reports/details.php M reports/index.php M reports/parse_ciqa.php M reports/parserfunc.php M reports/reportsfunctions.php M reports/run_tests.php M reports/sorttable.js M reports/test-insert.php M reports/todo.txt M reports/viewreports.php M running-tests.php M sample_tests/clean.php M sample_tests/sample005.php M sample_tests/sample007.php M sample_tests/sample008.php M sample_tests/sample022.php M sample_tests/sample025.php M write-test.php
diff --git a/api.php b/api.php index 0a057de..4b663d6 100644 --- a/api.php +++ b/api.php @@ -41,8 +41,8 @@ $SITE_UPDATE = date("D M d H:i:s Y T", filectime(__FILE__)); common_header(); ?> <p> -The QA API is simple, and is based on the query string. -Pass in type=qa-releases (the only type currently), along with the desired format (serialize or json). +The QA API is simple, and is based on the query string. +Pass in type=qa-releases (the only type currently), along with the desired format (serialize or json). </p> <p> diff --git a/autogenerate.php b/autogenerate.php index 8af9274..0cba4e8 100644 --- a/autogenerate.php +++ b/autogenerate.php @@ -9,12 +9,12 @@ common_header(); <h2>Auto-generating test cases</h2> <p> Although it's not possible to generate a complete PHPT test, it's quite easy to generate the - standard sections and some simple functions automatically, creating a test case "frame". + standard sections and some simple functions automatically, creating a test case "frame". To do this, you need: <ul> <li> A build pf PHP53 </li> <li> The file generate-phpt.phar, located in the PHP53 source under scripts/dev -</li></ul> +</li></ul> <p /> <p /> <p /> @@ -29,7 +29,7 @@ Test function cos() by calling it with its expected arguments echo "*** Test by calling method or function with its expected arguments ***\n" -$number = +$number = @@ -45,7 +45,7 @@ var_dump(cos( $number ) ); <p /> <h3>Completing the .phpt test file: </h3> <p /> -To turn this into a complete test case, all the developer has to do is to initialise $number to something reasonable +To turn this into a complete test case, all the developer has to do is to initialise $number to something reasonable and to add a section for the expected output. <p /> @@ -71,7 +71,7 @@ Use -h to list them, this is the output: -h ............................... Print this message </pre></div> <h3>Implementation notes</h3> -<p>The source code is under scripts/dev/generate-phpt/src. The phar file is generated using the script gtPackage.php. +<p>The source code is under scripts/dev/generate-phpt/src. The phar file is generated using the script gtPackage.php. The script works by using Reflection to work out what arguments a function or method expects and then setting up a function/method invocation. The catch with generating tests this way is that the script has to be run *using the level of PHP that you want to test*, diff --git a/buildtest-action.php b/buildtest-action.php index 87d804e..9271bf1 100644 --- a/buildtest-action.php +++ b/buildtest-action.php @@ -9,8 +9,8 @@ common_header(); if (count($_POST) > 0) { mail ("php-qa@lists.php.net", "PHP Test results", $d, "From: nore...@php.net"); print("thank you for your submission."); - } else { - print("Your submission was empty, please try again."); - } + } else { + print("Your submission was empty, please try again."); + } common_footer(); ?> diff --git a/buildtest-process.php b/buildtest-process.php index 50759e4..b703cf6 100644 --- a/buildtest-process.php +++ b/buildtest-process.php @@ -28,7 +28,7 @@ if (in_array($version, $QA_RELEASES['reported'])) { mail ("qa-repo...@lists.php.net", "Test results for $version [$status]", base64_decode($_POST['php_test_data']), "From: nore...@php.net"); } - + // Aggregator (http://qa.php.net/reports/) include 'reports/parserfunc.php'; $array = parse_phpmaketest($version, $status, base64_decode($_POST['php_test_data'])); diff --git a/expectf_details.php b/expectf_details.php index 5636fe5..b718c98 100644 --- a/expectf_details.php +++ b/expectf_details.php @@ -9,7 +9,7 @@ common_header(); <h1>EXPECTF substitution options</h1> <p>The --EXPECTF-- section uses a number of substitution tags for strings or digits that appear in test case output but which may vary between test runs. The most common -example of this is to use %s and %d to match the file path and line number which are +example of this is to use %s and %d to match the file path and line number which are output by PHP Warnings.</p> <p>The substitution tags and their meanings are summarised below</p> @@ -85,7 +85,7 @@ output by PHP Warnings.</p> </tr> </table> - + <?php common_footer(); diff --git a/handling-bugs.php b/handling-bugs.php index b77ebbd..9d482e3 100644 --- a/handling-bugs.php +++ b/handling-bugs.php @@ -90,7 +90,7 @@ Here are descriptions for each status:</p> <dd> This status is deprecated and can no longer be selected during modifications of bugs. Always use "Not a Bug" instead now. The originial - use was: + use was: <i>If this almost the same bug, both bugs are found 'duplicate' later on and have both useful information. Also mention what bug it's a duplicate of with a full url to the report this is duplicate of.</i> @@ -98,8 +98,8 @@ Here are descriptions for each status:</p> <dt>Critical</dt> <dd> - Only bugs that affect most/all users and/or are in the engine or - ext/standard. Only Verified and reproduced bugs in the latest + Only bugs that affect most/all users and/or are in the engine or + ext/standard. Only Verified and reproduced bugs in the latest Git revision can be marked critical. </dd> @@ -116,37 +116,37 @@ Here are descriptions for each status:</p> have just analyzed it. Also, add a comment. If you are unsure why it exists then use 'verified' instead. </dd> - + <dt>Verified</dt> <dd> If you're able to reproduce this bug with the information given. Be sure to test with the latest Git. Typically you aren't sure why it exists you just know it does and have confirmed it. </dd> - + <dt>Suspended</dt> <dd> - Usually used when there might be a fix in future and/or it relies on + Usually used when there might be a fix in future and/or it relies on something external to be fixed first. </dd> - + <dt>Wont fix</dt> <dd>When something is not considered a bug or the bug is not fixable.</dd> - + <dt>No feedback</dt> <dd> If no answer have been given by the reporter after we've asked them - something. Sometimes you will ask for an example script or ask the + something. Sometimes you will ask for an example script or ask the reporter to test using Git. </dd> - + <dt>Feedback</dt> <dd> You're asking the reporter for more information such as please use Git revision, and/or the smallest possible test script to reproduce the error, and/or a value for a certain PHP directive. </dd> - + <dt>Not a Bug (old: Bogus)</dt> <dd> This bug is not a bug, support related or just an assumed bug or the @@ -182,31 +182,31 @@ php-b...@lists.php.net being the default (most go here). Here's a list:</p> <dd><a href="http://news.php.net/group.php?group=php.mirrors">php-mirr...@lists.php.net</a></dd> </dl> -<p>Reclassifying will immediatly change which mailing list is used. If you -reclassify a bug and don't leave a comment then no email is sent to the mailing list. +<p>Reclassifying will immediatly change which mailing list is used. If you +reclassify a bug and don't leave a comment then no email is sent to the mailing list. So, be sure to leave a comment.</p> <h2>Tips and links</h2> <ul> <li> - The Jani Javascript bug popup window (right click to bookmark): + The Jani Javascript bug popup window (right click to bookmark): <a href='javascript:void(t=prompt("Get BUG report # ..",""));if(t){ void(top.location.href="http://bugs.php.net/bug.php?edit=1&id="+t);}'>here</a> </li> <li> Look at the <a href="http://bugs.php.net/stats.php">raw bug stats</a>. </li> <li> - Not leaving a comment means no email will be sent to the mailing list. + Not leaving a comment means no email will be sent to the mailing list. (all quickfix options leave comments) </li> <li> - If a version is from Git be sure to label it in the form: + If a version is from Git be sure to label it in the form: <b>x.y.z-dev</b> An example is: 5.6.0-dev or 7.0.0-dev. </li> <li> - If you have a question either email the - <a href="mailto:intern...@lists.php.net">intern...@lists.php.net</a> - mailing list or check out the #php.pecl channel in IRC on + If you have a question either email the + <a href="mailto:intern...@lists.php.net">intern...@lists.php.net</a> + mailing list or check out the #php.pecl channel in IRC on <a href="http://www.irchelp.org/irchelp/networks/efnet.txt">EFNET</a>. </li> </ul> diff --git a/howtohelp.php b/howtohelp.php index 09bb740..c25c1ea 100644 --- a/howtohelp.php +++ b/howtohelp.php @@ -32,7 +32,7 @@ common_header(); regular schedule, we're currently setting up a system to do this all automatically.<br /><br /> </li> - <li class="lihack">Give a PHP/QA Team member access to a server that + <li class="lihack">Give a PHP/QA Team member access to a server that you administrate, especially on ones running some of the more exotic Operation Systems. <br /><br /> To do this, please send mail to the PHP/QA email list (<a diff --git a/include/functions.php b/include/functions.php index fe0e03a..301e07d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,5 +1,5 @@ <?php -/* +/* (c) 2001 by Marco Kaiser (b...@php.net) and the PHP Group */ @@ -27,14 +27,14 @@ function common_footer($JS = array()) { } function is_valid_php_version($version, $QA_RELEASES = array()) { - + if (isset($QA_RELEASES['reported']) && in_array($version, $QA_RELEASES['reported'])) { return true; } - + if (preg_match('@^\d{1}\.\d{1}\.\d{1,}(?:(?:RC|alpha|beta)\d{0,2})?(?:-dev)?$@i', $version)) { return true; } - + return false; } diff --git a/include/release-qa.php b/include/release-qa.php index a23b23d..35584ff 100644 --- a/include/release-qa.php +++ b/include/release-qa.php @@ -12,8 +12,8 @@ Documentation: - Key is future PHP version number - Example: If 5.3.6 is the latest stable release, then use 5.3.7 because 5.3.7-dev is our qa version - Typically, this is the only part needing changed - - active (bool): - - It's active and being tested here + - active (bool): + - It's active and being tested here - Meaning, the version will be reported to the qa.reports list, and be linked at qa.php.net - File extensions .tar.gz and .tar.bz2 are assumed to be available - release (array): @@ -115,8 +115,8 @@ $QA_RELEASES = array( /*** End Configuration *******************************************************************/ -// This is a list of the possible checksum values that can be supplied with a QA release. Any -// new algorithm is read from the $QA_RELEASES array under the 'release' index for each version +// This is a list of the possible checksum values that can be supplied with a QA release. Any +// new algorithm is read from the $QA_RELEASES array under the 'release' index for each version // in the form of "$algorithm_$filetype". // // For example, if SHA512 were to be supported, the following indices would have to be added: @@ -134,18 +134,18 @@ $QA_CHECKSUM_TYPES = [ 'sha256' ]; foreach ($QA_RELEASES as $pversion => $info) { if (isset($info['active']) && $info['active']) { - + // Allow -dev versions of all active types // Example: 5.3.6-dev $QA_RELEASES['reported'][] = "{$pversion}-dev"; $QA_RELEASES[$pversion]['dev_version'] = "{$pversion}-dev"; - + // Allow -dev version of upcoming qa releases (rc/alpha/beta) // @todo confirm this php version format for all dev versions if ((int)$info['release']['number'] > 0) { $QA_RELEASES['reported'][] = "{$pversion}{$info['release']['type']}{$info['release']['number']}"; if (!empty($info['release']['baseurl'])) { - + // php.net filename format for qa releases // example: php-5.3.0RC2 $fn_base = 'php-' . $pversion . $info['release']['type'] . $info['release']['number']; diff --git a/index.php b/index.php index 5c8ac9d..53b7189 100644 --- a/index.php +++ b/index.php @@ -29,7 +29,7 @@ common_header(); <p> <br> <strong>Windows users:</strong> - See <a href="http://windows.php.net/qa/">here</a> for the Windows QA builds and + See <a href="http://windows.php.net/qa/">here</a> for the Windows QA builds and <a href="http://windows.php.net/snaps/">here</a> for the Windows Snapshot builds. </p> diff --git a/pftt.php b/pftt.php index 394886e..a82bdb3 100755 --- a/pftt.php +++ b/pftt.php @@ -37,7 +37,7 @@ if ($branches!==FALSE) { } } } - + $red = is_file(BASE_REPORT_DIR."/$branch/$latest_revision/FAIL_CRASH.txt"); ?> @@ -48,7 +48,7 @@ if ($branches!==FALSE) { <td style="width:300px"><a href="build.php?branch=<?php echo urlencode($branch); ?>&revision=<?php echo urlencode($latest_revision); ?>"><?php echo htmlentities($latest_revision); ?></a></td> </tr> </table> -<br/> +<br/> <?php } // end if @@ -58,7 +58,7 @@ if ($branches!==FALSE) { ?> <p><strong>PFTT Source Code:</strong> <a href="http://git.php.net/?p=pftt2.git">http://git.php.net/?p=pftt2.git</a></p> - + <p><strong>PFTT Binaries:</strong> <a href="http://windows.php.net/downloads/snaps/ostc/pftt/" target="_blank">http://windows.php.net/downloads/snaps/ostc/pftt/</a></p> <br/> diff --git a/pftt_report.php b/pftt_report.php index bd2b7da..6fd0353 100755 --- a/pftt_report.php +++ b/pftt_report.php @@ -68,7 +68,7 @@ if ((strpos($revision, ".")===FALSE and substr($revision, 0, 1)!="r") or strlen( } // validate report_file -if ($_FILES['report_file']['size'] > 600000 or $_FILES['report_file']['size'] < 100 ) { +if ($_FILES['report_file']['size'] > 600000 or $_FILES['report_file']['size'] < 100 ) { // some PhpUnit reports can be quite large exit_error('Invalid report file size'); } else if ($_FILES['report_file']['type']!="text/html") { diff --git a/projects.php b/projects.php index 4eedb11..9f7e215 100644 --- a/projects.php +++ b/projects.php @@ -31,20 +31,20 @@ common_header(); </ul> <h3>Provide Client-Side Bug Reporting via PHP Interpreter</h3> <ul> - <li><span class="lihack">Add functionality to PHP to help php users submit accurate bugs. + <li><span class="lihack">Add functionality to PHP to help php users submit accurate bugs. </span></li> - <li><span class="lihack">Probably the best solution that has been proposed is the addition - of a submit_bug() function that would automatically send platform - data, along with PHP interpreter state when it is called. This - solution would address the security concerns that have been raised - by the possible display of platform information to malicious visitors. + <li><span class="lihack">Probably the best solution that has been proposed is the addition + of a submit_bug() function that would automatically send platform + data, along with PHP interpreter state when it is called. This + solution would address the security concerns that have been raised + by the possible display of platform information to malicious visitors. </span></li> - <li><span class="lihack">Bugs gathered from this source would need to be filtered by + <li><span class="lihack">Bugs gathered from this source would need to be filtered by an agent before they could be considered truly useful. </span></li> - <li><span class="lihack">Note that filtering many spurious bug reports should be relatively - simple. Bug reports that were generated due to parse errors could + <li><span class="lihack">Note that filtering many spurious bug reports should be relatively + simple. Bug reports that were generated due to parse errors could be ignored or flagged as low priority. </span></li> - <li><span class="lihack">However, all of this would require developer involvement and + <li><span class="lihack">However, all of this would require developer involvement and is probably the least plausible goal! </span></li> </ul> <?php diff --git a/pulls/Markdown.Converter.js b/pulls/Markdown.Converter.js index d01f1ab..cfec79e 100644 --- a/pulls/Markdown.Converter.js +++ b/pulls/Markdown.Converter.js @@ -4,7 +4,7 @@ if (typeof exports === "object" && typeof require === "function") // we're in a Markdown = exports; else Markdown = {}; - + // The following text is included for historical reasons, but should // be taken with a pinch of salt; it's not all true anymore. @@ -133,7 +133,7 @@ else // Don't do that. if (g_urls) throw new Error("Recursive call to converter.makeHtml"); - + // Create the private state objects. g_urls = new SaveHash(); g_titles = new SaveHash(); @@ -305,7 +305,7 @@ else text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement); // Special case just for <hr />. It was easier to make a special case than - // to make the other regex more complicated. + // to make the other regex more complicated. /* text = text.replace(/ @@ -425,9 +425,9 @@ else // Must come after _DoAnchors(), because you can use < and > // delimiters in inline links like [this](<url>). text = _DoAutoLinks(text); - + text = text.replace(/~P/g, "://"); // put in place to prevent autolinking; reset now - + text = _EncodeAmpsAndAngles(text); text = _DoItalicsAndBold(text); @@ -443,7 +443,7 @@ else // don't conflict with their use in Markdown for code, italics and strong. // - // Build a regex to find HTML tags and comments. See Friedl's + // Build a regex to find HTML tags and comments. See Friedl's // "Mastering Regular Expressions", 2nd Ed., pp. 200-201. // SE: changed the comment part of the regex @@ -517,7 +517,7 @@ else | [^()] )*? - )>? + )>? [ \t]* ( // $5 (['"]) // quote char = $6 @@ -656,7 +656,7 @@ else return text; } - + function attributeEncode(text) { // unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title) // never makes sense to have verbatim HTML in it (and the sanitizer would totally break it) @@ -689,7 +689,7 @@ else return whole_match; } } - + alt_text = escapeCharacters(attributeEncode(alt_text), "*_[]()"); url = escapeCharacters(url, "*_"); var result = "<img src=\"" + url + "\" alt=\"" + alt_text + "\""; @@ -713,7 +713,7 @@ else // Setext-style headers: // Header 1 // ======== - // + // // Header 2 // -------- // @@ -872,7 +872,7 @@ else // // We changed this to behave identical to MarkdownSharp. This is the constructed RegEx, // with {MARKER} being one of \d+[.] or [*+-], depending on list_type: - + /* list_str = list_str.replace(/ (^[ \t]*) // leading whitespace = $1 @@ -920,7 +920,7 @@ else function _DoCodeBlocks(text) { // // Process Markdown `<pre><code>` blocks. - // + // /* text = text.replace(/ @@ -968,26 +968,26 @@ else function _DoCodeSpans(text) { // // * Backtick quotes are used for <code></code> spans. - // + // // * You can use multiple backticks as the delimiters if you want to // include literal backticks in the code span. So, this input: - // + // // Just type ``foo `bar` baz`` at the prompt. - // + // // Will translate to: - // + // // <p>Just type <code>foo `bar` baz</code> at the prompt.</p> - // + // // There's no arbitrary limit to the number of backticks you // can use as delimters. If you need three consecutive backticks // in your code, use four for delimiters, etc. // // * You can use spaces to get literal backticks at the edges: - // + // // ... type `` `bar` `` ... - // + // // Turns to: - // + // // ... type <code>`bar`</code> ... // @@ -1120,7 +1120,7 @@ else var grafs = text.split(/\n{2,}/g); var grafsOut = []; - + var markerRe = /~K(\d+)K/; // @@ -1201,11 +1201,11 @@ else // *except* for the <http://www.foo.com> case // automatically add < and > around unadorned raw hyperlinks - // must be preceded by space/BOF and followed by non-word/EOF character + // must be preceded by space/BOF and followed by non-word/EOF character text = text.replace(/(^|\s)(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\]])($|\W)/gi, "$1<$2$3>$4"); // autolink anything like <http://example.com> - + var replacer = function (wholematch, m1) { return "<a href=\"" + m1 + "\">" + pluginHooks.plainLinkText(m1) + "</a>"; } text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer); @@ -1287,7 +1287,7 @@ else var _problemUrlChars = /(?:["'*()[\]:]|~D)/g; - // hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems + // hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems function encodeProblemUrlChars(url) { if (!url) return ""; diff --git a/pulls/Markdown.Sanitizer.js b/pulls/Markdown.Sanitizer.js index cc5826f..c3283e5 100644 --- a/pulls/Markdown.Sanitizer.js +++ b/pulls/Markdown.Sanitizer.js @@ -7,7 +7,7 @@ output = window.Markdown; Converter = output.Converter; } - + output.getSanitizingConverter = function () { var converter = new Converter(); converter.hooks.chain("postConversion", sanitizeHtml); @@ -37,9 +37,9 @@ /// <summary> /// attempt to balance HTML tags in the html string /// by removing any unmatched opening or closing tags - /// IMPORTANT: we *assume* HTML has *already* been + /// IMPORTANT: we *assume* HTML has *already* been /// sanitized and is safe/sane before balancing! - /// + /// /// adapted from CODESNIPPET: A8591DBA-D1D3-11DE-947C-BA5556D89593 /// </summary> function balanceTags(html) { diff --git a/pulls/api.php b/pulls/api.php index 6f25d72..b29aae6 100644 --- a/pulls/api.php +++ b/pulls/api.php @@ -22,7 +22,7 @@ function verify_password($user, $pass) 'password' => $pass, ) ); - + $opts = array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', diff --git a/pulls/jquery-ui.css b/pulls/jquery-ui.css index 1e401e4..a107801 100644 --- a/pulls/jquery-ui.css +++ b/pulls/jquery-ui.css @@ -341,7 +341,7 @@ * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete { position: absolute; cursor: default; } /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ @@ -397,8 +397,8 @@ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } /*button text element */ .ui-button .ui-button-text { display: block; line-height: 1.4; } @@ -434,7 +434,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad */ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } @@ -506,7 +506,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } .ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-month, .ui-datepicker select.ui-datepicker-year { width: 49%;} .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } diff --git a/pulls/jquery.ba-bbq.min.js b/pulls/jquery.ba-bbq.min.js index 80de36f..6473e19 100644 --- a/pulls/jquery.ba-bbq.min.js +++ b/pulls/jquery.ba-bbq.min.js @@ -1,7 +1,7 @@ /* * jQuery BBQ: Back Button & Query Library - v1.3pre - 8/26/2010 * http://benalman.com/projects/jquery-bbq-plugin/ - * + * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ @@ -10,7 +10,7 @@ /* * jQuery hashchange event - v1.3 - 7/21/2010 * http://benalman.com/projects/jquery-hashchange-plugin/ - * + * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ diff --git a/pulls/jsrender.js b/pulls/jsrender.js index 5998650..5c1171c 100644 --- a/pulls/jsrender.js +++ b/pulls/jsrender.js @@ -98,7 +98,7 @@ function View( context, path, parentView, data, template ) { // Set additional context on this view (which will modify the context inherited from the parent, and be inherited by child views) ctx : context && context === parentContext ? parentContext - : (parentContext ? extend( extend( {}, parentContext ), context ) : context||{}), + : (parentContext ? extend( extend( {}, parentContext ), context ) : context||{}), // If no jQuery, extend does not support chained copies - so limit to two parameters parent: parentView }; @@ -129,7 +129,7 @@ extend( $, { return view.onElse ? view.onElse( this, arguments ) : ""; }, each: function() { - var i, + var i, self = this, result = "", args = arguments, @@ -139,7 +139,7 @@ extend( $, { for ( i = 0; i < l; i++ ) { result += args[ i ] ? render( args[ i ], content, self.ctx || view.ctx, view, self._path, self._ctor ) : ""; } - return l ? result + return l ? result // If no data parameter, use the current $data from view, and render once : result + render( view.data, content, view.ctx, view, self._path, self.tag ); }, @@ -268,27 +268,27 @@ extend( $, { if ( !tagFn ) { return ""; } - + content = content && view.tmpl.nested[ content - 1 ]; tagProperties.tmpl = tagProperties.tmpl || content || undefined; // Set the tmpl property to the content of the block tag, unless set as an override property on the tag - + if ( presenters && presenters[ tag ]) { - ctx = extend( extend( {}, tagProperties.ctx ), tagProperties ); - delete ctx.ctx; - delete ctx._path; + ctx = extend( extend( {}, tagProperties.ctx ), tagProperties ); + delete ctx.ctx; + delete ctx._path; delete ctx.tmpl; - tagProperties.ctx = ctx; + tagProperties.ctx = ctx; tagProperties._ctor = tag + (hash ? "=" + hash.slice( 0, -1 ) : ""); tagProperties = extend( extend( {}, tagFn ), tagProperties ); tagFn = viewsNs.tags.each; // Use each to render the layout template against the data - } + } tagProperties._encode = encode; tagProperties._view = view; ret = tagFn.apply( tagProperties, args.length > 5 ? slice.call( args, 5 ) : [view.data] ); - return ret || (ret === undefined ? "" : ret.toString()); // (If ret is the value 0 or false or null, will render to string) + return ret || (ret === undefined ? "" : ret.toString()); // (If ret is the value 0 or false or null, will render to string) } }, diff --git a/pulls/pullrequests.js b/pulls/pullrequests.js index ba502c7..61d8b53 100644 --- a/pulls/pullrequests.js +++ b/pulls/pullrequests.js @@ -50,7 +50,7 @@ repoList.prototype.setData = function(data) { function loginHandler() { var t = this; this.user = false; - this.logindialog = $("#loginDialog").dialog({autoOpen: false}); + this.logindialog = $("#loginDialog").dialog({autoOpen: false}); this.checkLoggedIn(); $("#notloggedin").click(function(ev) { t.showLoginForm(); @@ -60,7 +60,7 @@ function loginHandler() { t.login(); t.logindialog.dialog("close"); ev.preventDefault(); - } ); + } ); } loginHandler.prototype.showLoginForm = function() { @@ -176,7 +176,7 @@ function loadRepo(repo, url) { for (var i in repo_labels.data) { var li_el, input_html, was_checked; - + li_el = ul_el.append('<li style="display: block;">') $('[id="pr-' + that.data("number") + '-label-' + repo_labels.data[i].name + '"]').each(function(i, v) { @@ -195,7 +195,7 @@ function loadRepo(repo, url) { input_html += " />"; li_el.append(input_html + repo_labels.data[i].name); } - + $("button", dia).click(function() { dia.dialog("close"); }); } }); @@ -229,7 +229,7 @@ function loadRepo(repo, url) { $.bbq.pushState({ repo: repo }); } }); - + } function updateRepo(reponame, num, dia) { diff --git a/regtests/README b/regtests/README index 5b274b2..b34dc9b 100644 --- a/regtests/README +++ b/regtests/README @@ -58,7 +58,7 @@ directory #:>. ./test/compare -this will run diff over the outputs and put the results in +this will run diff over the outputs and put the results in test/compare.out diff --git a/regtests/maketests b/regtests/maketests index ff3d850..2fbdb8e 100755 --- a/regtests/maketests +++ b/regtests/maketests @@ -2,16 +2,16 @@ # ################################################################## # -# TITLE: maketests.pl -# +# TITLE: maketests.pl +# # This PERL script scans for files in a directory of tests, # and sets up two batch scripts from them. One to run the # tests, and another to compare actual results with ideal -# results for each test. +# results for each test. # # ASSUMPTIONS: # -# - The test files are executable, and produce results in +# - The test files are executable, and produce results in # a readable form to standard output. # # AUTHOR: @@ -92,10 +92,10 @@ $compareExitCmds = "$echoPgm Compare log end... >> $compareLogPath\n"; # ---------------------------------------------------------------- -# Read in the test suite bin entries and save a) test file names +# Read in the test suite bin entries and save a) test file names # and b) test file prefixes, for use in finding other related # files, in an associative array. The keys are the file names, -# and the values are the +# and the values are the # opendir (BIN_DIR, $testSuiteBin) || die "Aborting: Can't read dir $testSuiteBin\n"; @@ -104,7 +104,7 @@ while ( $filename = readdir(BIN_DIR) ) { # Note that $prefix will be the same name as $filename # in cases where there is no 'prefix.suffix' form to # the file name. This is OK, and expected on UNIX machines. - + ($prefix) = split( /\./, $filename ) ; $testFilePrefixes{$filename} = $prefix ; } @@ -145,17 +145,17 @@ print TMASTER "$scriptEntryCmds"; open (TCOMPARE, "> $compareScriptPath") || die "Aborting: Can't create $comparePath\n"; print TCOMPARE "$compareEntryCmds"; - + foreach $test (keys(%testFilePrefixes)) { print "Adding drop-in test $test...\n"; print TMASTER "$echoPgm $test...\n"; # -------------------------------------------------------- - # Create preprocessing entries for this test. If it's a + # Create preprocessing entries for this test. If it's a # PHP file, invoke it using the $phpExecCmd # - + foreach $preFile (@testPreFiles) { ($prefix) = split( /\./, $preFile ) ; if ($prefix eq $testFilePrefixes{$test}) { @@ -167,7 +167,7 @@ foreach $test (keys(%testFilePrefixes)) { # ----------------------------------------------------- # Create master script main entry for this test # - + $logFile = "$testFilePrefixes{$test}$logSuffix"; $logActual = "$testActuals/$logFile"; $logIdeal = "$testIdeals/$logFile"; @@ -176,10 +176,10 @@ foreach $test (keys(%testFilePrefixes)) { print TMASTER "$testSuiteBin/$test > $logActual\n"; # -------------------------------------------------------- - # Create postprocessing entries for this test. If it�s a + # Create postprocessing entries for this test. If it�s a # batch file, invoke it using the $batExecCmd # - + foreach $postFile (@testPostFiles) { ($prefix) = split( /\./, $postFile ) ; if ($prefix eq $testFilePrefixes{$test}) { @@ -196,9 +196,9 @@ foreach $test (keys(%testFilePrefixes)) { # placeholder for the ideal file contents that will # be exposed during the compare step. # - - print TCOMPARE "$echoPgm -- $logIdeal vs. $logActual -- >> $compareLogPath\n"; - print TCOMPARE "$diffPgm $logIdeal $logActual >> $compareLogPath\n\n"; + + print TCOMPARE "$echoPgm -- $logIdeal vs. $logActual -- >> $compareLogPath\n"; + print TCOMPARE "$diffPgm $logIdeal $logActual >> $compareLogPath\n\n"; if (! -e $logIdeal) { open (IDEAL, "> $logIdeal") || die "Aborting: Can't create $logIdeal\n"; diff --git a/regtests/runtests b/regtests/runtests index b64b07a..a6d0879 100755 --- a/regtests/runtests +++ b/regtests/runtests @@ -2,16 +2,16 @@ # ################################################################## # -# TITLE: maketests.pl -# +# TITLE: maketests.pl +# # This PERL script scans for files in a directory of tests, # and sets up two batch scripts from them. One to run the # tests, and another to compare actual results with ideal -# results for each test. +# results for each test. # # ASSUMPTIONS: # -# - The test files are executable, and produce results in +# - The test files are executable, and produce results in # a readable form to standard output. # # AUTHOR: @@ -93,10 +93,10 @@ $compareExitCmds = "$echoPgm Compare log end... >> $compareLogPath\n"; # ---------------------------------------------------------------- -# Read in the test suite bin entries and save a) test file names +# Read in the test suite bin entries and save a) test file names # and b) test file prefixes, for use in finding other related # files, in an associative array. The keys are the file names, -# and the values are the +# and the values are the # opendir (BIN_DIR, $testSuiteBin) || die "Aborting: Can't read dir $testSuiteBin\n"; @@ -105,7 +105,7 @@ while ( $filename = readdir(BIN_DIR) ) { # Note that $prefix will be the same name as $filename # in cases where there is no 'prefix.suffix' form to # the file name. This is OK, and expected on UNIX machines. - + ($prefix) = split( /\./, $filename ) ; $testFilePrefixes{$filename} = $prefix ; } @@ -146,17 +146,17 @@ print TMASTER "$scriptEntryCmds"; open (TCOMPARE, "> $compareScriptPath") || die "Aborting: Can't create $comparePath\n"; print TCOMPARE "$compareEntryCmds"; - + foreach $test (keys(%testFilePrefixes)) { print "Adding drop-in test $test...\n"; print TMASTER "$echoPgm $test...\n"; # -------------------------------------------------------- - # Create preprocessing entries for this test. If it's a + # Create preprocessing entries for this test. If it's a # PHP file, invoke it using the $phpExecCmd # - + foreach $preFile (@testPreFiles) { ($prefix) = split( /\./, $preFile ) ; if ($prefix eq $testFilePrefixes{$test}) { @@ -168,7 +168,7 @@ foreach $test (keys(%testFilePrefixes)) { # ----------------------------------------------------- # Create master script main entry for this test # - + $logFile = "$testFilePrefixes{$test}$logSuffix"; $logActual = "$testActuals/$logFile"; $logIdeal = "$testIdeals/$logFile"; @@ -177,10 +177,10 @@ foreach $test (keys(%testFilePrefixes)) { print TMASTER "$testSuiteBin/$test > $logActual\n"; # -------------------------------------------------------- - # Create postprocessing entries for this test. If it�s a + # Create postprocessing entries for this test. If it�s a # batch file, invoke it using the $batExecCmd # - + foreach $postFile (@testPostFiles) { ($prefix) = split( /\./, $postFile ) ; if ($prefix eq $testFilePrefixes{$test}) { @@ -197,9 +197,9 @@ foreach $test (keys(%testFilePrefixes)) { # placeholder for the ideal file contents that will # be exposed during the compare step. # - - print TCOMPARE "$echoPgm **** $logIdeal vs. $logActual **** >> $compareLogPath\n"; - print TCOMPARE "$diffPgm $logIdeal $logActual >> $compareLogPath\n\n"; + + print TCOMPARE "$echoPgm **** $logIdeal vs. $logActual **** >> $compareLogPath\n"; + print TCOMPARE "$diffPgm $logIdeal $logActual >> $compareLogPath\n\n"; if (! -e $logIdeal) { open (IDEAL, "> $logIdeal") || die "Aborting: Can't create $logIdeal\n"; diff --git a/regtests/test/suite/bin/test_class_inheritance.php b/regtests/test/suite/bin/test_class_inheritance.php index 3f903e6..5cfa1e6 100755 --- a/regtests/test/suite/bin/test_class_inheritance.php +++ b/regtests/test/suite/bin/test_class_inheritance.php @@ -2,7 +2,7 @@ class BaseClass { var $class_name = "BaseClass"; - + function BaseClass($value) { print "value is '$value'\n"; } @@ -14,7 +14,7 @@ class BaseClass { class ChildClass { var $class_name = "ChildClass"; - + function ChildClass($value, $new_value) { BaseClass::BaseClass($value); print "new value is '$new_value'\n"; diff --git a/regtests/test/suite/bin/testscanf.php b/regtests/test/suite/bin/testscanf.php index 5878797..14efcd7 100755 --- a/regtests/test/suite/bin/testscanf.php +++ b/regtests/test/suite/bin/testscanf.php @@ -27,11 +27,11 @@ function do_sscanf($string, $format) { function run_sscanf_test_cases() { global $testFileName; - echo "<h3><em><br>Running Test Cases from $testFileName<br></em></h3>"; + echo "<h3><em><br>Running Test Cases from $testFileName<br></em></h3>"; $arr = file( $testFileName ); for ($i=0;$i < count($arr);$i++) { $line_arr = explode("|",$arr[$i]); - + $format = $line_arr[0]; $string = $line_arr[1]; if (count($arr) > 2) { @@ -53,18 +53,18 @@ reference)-<br>"; $decimal = -1; $string = ""; $hex = 0; - $float = 0.0; + $float = 0.0; $octal = 0.0; $int = -1; - - echo "<h3><em><br>Simple Test<br></em></h3>"; + + echo "<h3><em><br>Simple Test<br></em></h3>"; echo "sscanf('10','%d',&\$decimal) <br>"; echo "<br>BEFORE : <br> decimal = $decimal."; $foo = sscanf("10","%d",&$decimal); echo "<br>AFTER : <br> decimal = $decimal <br>"; - echo "<h3><em><br>Simple Test 2<br></em></h3>"; + echo "<h3><em><br>Simple Test 2<br></em></h3>"; echo "sscanf(\"ghost 0xface\",\"%s %x\",&\$string, &\$int)<br>"; echo "<br>BEFORE : <br> string = $string, int = $int<br>"; $foo = sscanf("ghost 0xface","%s %x",&$string, &$int); @@ -73,20 +73,20 @@ reference)-<br>"; print_value( $foo,""); echo " conversions <br>"; - echo "<h3><em><br>Multiple specifiers<br></em></h3>"; + echo "<h3><em><br>Multiple specifiers<br></em></h3>"; echo "sscanf(\"jabberwocky 1024 0xFF 1.024 644 10\", \"%s %d %x %f %o %i\", &\$string,&\$decimal,&\$hex,&\$float,&\$octal,&\$int);<br>"; echo "<br>BEFORE : <br>"; echo "Decimal = $decimal, String = $string, Hex = $hex<br>"; - echo "Octal = $octal , Float = $float, Int = $int<br>"; + echo "Octal = $octal , Float = $float, Int = $int<br>"; $foo = sscanf( "jabberwocky 1024 0xFF 1.024 644 10", "%s %d %x %f %o %i", &$string,&$decimal,&$hex,&$float,&$octal,&$int); echo "<br>AFTER :<br>"; echo "decimal = $decimal, string = $string, hex = $hex<br>"; - echo "octal = $octal , float = $float, int = $int<br>"; - + echo "octal = $octal , float = $float, int = $int<br>"; + echo " sscan reports : "; print_value( $foo,""); echo " conversions <br>"; @@ -100,6 +100,6 @@ if (!function_exists('sscanf')) { echo "<strong>I'm sorry but sscanf() does not exist !i</strong><br>"; } else { simple_tests(); - run_sscanf_test_cases(); + run_sscanf_test_cases(); } ?> diff --git a/reports/README b/reports/README index 498d575..2d8de8c 100644 --- a/reports/README +++ b/reports/README @@ -3,7 +3,7 @@ Database format In db/ folder, there is one file for each PHP version. The sqlite files CANNOT be access directly (forced to use the report interface). -Each sqlite file has the following schema : +Each sqlite file has the following schema : CREATE TABLE failed ( `id` integer PRIMARY KEY AUTOINCREMENT, @@ -24,10 +24,10 @@ CREATE TABLE reports ( user_email varchar(64) default null ) -The SQLite file is created in parserfunc.php:insertToDb_phpmaketest() +The SQLite file is created in parserfunc.php:insertToDb_phpmaketest() if the sqlite file '$VERSION.sqlite' does not exist. -Each report adds a line in `reports` table with the following fields : +Each report adds a line in `reports` table with the following fields : - id : integer auto incremented - date : date the report was sent - status : 0 = failed, 1 = success. If status is something else (should not !), we exit() @@ -37,15 +37,15 @@ Each report adds a line in `reports` table with the following fields : - phpinfo : phpinfo() output - user_email : email mangled (user at domain dot com) -Then, for each failed test, we add a line in `failed` table : +Then, for each failed test, we add a line in `failed` table : - id : integer auto increment - id_report : id of the report - test_name : path of the test. Example : "/ext/hash/tests/mhash_001.phpt" - output : full output of test - diff : diff of test compared to what was expected. There may be some glitches with spaces and %s - signature : binary(16) built with md5($name.'__'.$test['diff']) - In URLs, the binary md5 is transformed as base64 (like 03410e89b1d2737ce178a795f298ae64). - It is used to track differencies between each failed test in DB : we compare only the signature, + In URLs, the binary md5 is transformed as base64 (like 03410e89b1d2737ce178a795f298ae64). + It is used to track differencies between each failed test in DB : we compare only the signature, which is simpler than checking every diff. @@ -55,7 +55,7 @@ When you do a 'make test' on your PHP sourcedir, you can send a report when some If you do this, the test program will build a flat file containing all failed tests output/diff and send it to http://qa.php.net/buildtest-process.php (via POST method). Previously, this page only sent the report to a dedicated mailing list (qa-reports at lists.php.net). -We now add a parser that intercept the data and send it to the function located in +We now add a parser that intercept the data and send it to the function located in reports/parserfunc.php:parse_phpmaketest() This function transforms (with much regexp) the data (a big string in php format) to an array. This array is then given to reports/parserfunc.php:insertToDb_phpmaketest() that insert it to the diff --git a/reports/convert.php b/reports/convert.php index ec7011b..0cdc8f1 100644 --- a/reports/convert.php +++ b/reports/convert.php @@ -23,7 +23,7 @@ while (false !== ($entry = $d->read())) { if (substr($entry, -6) == 'sqlite') { printf("%-20s ", $entry); $dbi = new SQLite3('db/'.$entry, SQLITE3_OPEN_READWRITE) or exit('cannot open DB to record results'); - + foreach ($queriesCreate as $table => $query) { $dbi->exec($query); if ($dbi->lastErrorCode() != '') echo $dbi->lastErrorMsg(); @@ -31,7 +31,7 @@ while (false !== ($entry = $d->read())) { // patch add field success @$dbi->exec('ALTER TABLE reports ADD COLUMN success unsigned int(10) NOT NULL default 0'); echo $dbi->lastErrorMsg(); - + $dbi->close(); echo "\n"; } diff --git a/reports/details.php b/reports/details.php index 93dc82c..00acc46 100644 --- a/reports/details.php +++ b/reports/details.php @@ -106,7 +106,7 @@ function switchVisibility(elem) } else { echo ' <td>***'.strstr($report['user_email'], ' at ').'</td>'."\n"; } - + echo ' <td><a href="details.php?version='.$version.'&signature='.$signature.'&idreport='.$report['id'].'">'; echo '<img src="report.png" title="View phpinfo and environment" border="0" /></a></td>'."\n"; echo ' </tr>'."\n"; @@ -130,8 +130,8 @@ if (isset($_GET['idreport'])) { echo '</pre><hr size=1 />'; echo '<a name="buildenv"></a><h2>Build environment</h2><pre>'; echo htmlspecialchars(str_replace( - $reportsArray[$idreport]['user_email'], - '*** (truncated on purpose) ***', + $reportsArray[$idreport]['user_email'], + '*** (truncated on purpose) ***', $reportsArray[$idreport]['build_env'] ), ENT_QUOTES, 'UTF-8'); diff --git a/reports/index.php b/reports/index.php index 48d2403..c376abc 100644 --- a/reports/index.php +++ b/reports/index.php @@ -14,7 +14,7 @@ common_header(); </p> <p> -<a href="/pftt.php">PFTT</a> +<a href="/pftt.php">PFTT</a> The Php Full Test Tool (PFTT) is a cross-platform test tool for PHP Core and Applications developed by Microsoft, primarily for PHP on Microsoft Windows, Windows Server and Azure. PFTT covers the PHP ecosystem and is designed for convenience, thoroughness and speed: PFTT can run PHPT and PhpUnit tests across a variety of scenarios, including on Apache. diff --git a/reports/parse_ciqa.php b/reports/parse_ciqa.php index 0abc5b1..8bf0594 100644 --- a/reports/parse_ciqa.php +++ b/reports/parse_ciqa.php @@ -41,12 +41,12 @@ foreach ($rss->entry as $test) { .'./architecture=([^/]{1,})/([0-9]{1,})@', (string) $linkAttr['href'], $pos); if (!$z) continue; - + // check if we already did this if (isset($latestVersion[ $pos[1] ]) && $latestVersion[ $pos[1] ] >= (int) $pos[3]) { continue; } - + $elem = array( 'id' => (int) $pos[3], @@ -57,11 +57,11 @@ foreach ($rss->entry as $test) { ); //keep it ! $buildArray[] = $elem; - + // update what has been done so far if (!isset($newLatestVersion[ $pos[1] ]) || $newLatestVersion[ $pos[1] ] < $elem['id']) $newLatestVersion[ $pos[1] ] = $elem['id']; - + // stop at 5 reports (take time to parse) if (count($buildArray) == 5) break; } @@ -77,33 +77,33 @@ echo "We have ".count($buildArray)." builds to parse ... \n\n"; */ $failingTests = array(); $successfulTests = array(); - + foreach ($buildArray as $build) { printf(" * #%s (%5s) - %-30s ", $build['id'], $build['version'], $build['archi']); - - // retrieve and parse junit artefact + + // retrieve and parse junit artefact $junitxml = new SimpleXMLElement($build['url'].'/artifact/junit.xml', 0, true); //$junitxml = new SimpleXMLElement('sample-junit.xml', LIBXML_NOCDATA, true); - + foreach ($junitxml->testsuite as $suite) { foreach ($suite->testsuite as $subsuite) { foreach ($subsuite->testcase as $case) { $attr = $case->attributes(); - + if (substr($attr['classname'], 0, 8) == 'php-src.') { $uri = '/'.str_replace('.', '/', substr($attr['classname'], 8)).'/'. substr($attr['name'], 0, strpos($attr['name'], '.phpt')+5); } else continue; - + // add it to array if (isset($case->failure)) { $fail = $case->failure->attributes(); - - if ($fail->type == 'FAILED') + + if ($fail->type == 'FAILED') $failingTests[$build['version']][$uri] = trim( preg_replace( - '@ [^\s]{1,}'.substr($uri, 0, -1).'@', - ' %s/'.basename(substr($uri, 0, -1)), + '@ [^\s]{1,}'.substr($uri, 0, -1).'@', + ' %s/'.basename(substr($uri, 0, -1)), (string) $case->failure ) ); @@ -113,7 +113,7 @@ foreach ($buildArray as $build) { } } elseif (isset($case->skipped)) { // do nothing - + } else { // success $successfulTests[$build['version']][$uri] = true; @@ -122,9 +122,9 @@ foreach ($buildArray as $build) { } } unset($junitxml); // free memory - - printf("Success: %5s Fail: %5s (from all builds parsed)\n", - count($successfulTests[$build['version']]), + + printf("Success: %5s Fail: %5s (from all builds parsed)\n", + count($successfulTests[$build['version']]), count($failingTests[$build['version']]) ); } @@ -137,15 +137,15 @@ require '../include/functions.php'; foreach ($successfulTests as $version => $successTests) { echo "* ".$version." "; - + $firstArray = array (); - + // determine status (success or failure ?) - if (count($failingTests[$version]) == 0) + if (count($failingTests[$version]) == 0) $firstArray['status'] = 'success'; - else + else $firstArray['status'] = 'failed'; - + // determine correct version // hard because we only have "5.4" and we know it's dev, so find next coming version ? foreach ($QA_RELEASES as $ver => $releaseData) { @@ -154,35 +154,35 @@ foreach ($successfulTests as $version => $successTests) { break; } } - + if (!isset($firstArray['version'])) { // for trunk atm die('cannot determine version for '.$version); } - + // email $firstArray['userEmail'] = 'ciqa'; // magic value - + // date $firstArray['date'] = time(); - + $firstArray['phpinfo'] = ''; $firstArray['buildEnvironment'] = ''; - + // failed tests $firstArray['failedTest'] = array_keys($failingTests[$version]); - + // expected Failed Test $firstArray['expectedFailedTest'] = array(); - + // success $firstArray['succeededTest'] = array_keys($successTests); - + // tests foreach ($failingTests[$version] as $test => $diff) { $firstArray['tests'][$test] = array ('output' => '', 'diff' => str_replace("\n", "\x0d\n", $diff)); } - + $status = insertToDb_phpmaketest($firstArray, $QA_RELEASES); if ($status === true) echo "SUCCESS !\n"; else echo " ERROR :( \n"; diff --git a/reports/parserfunc.php b/reports/parserfunc.php index b353829..c071996 100644 --- a/reports/parserfunc.php +++ b/reports/parserfunc.php @@ -18,7 +18,7 @@ /** * Insert PHP make test results in SQLite database * - * The following structure must be used as first array : + * The following structure must be used as first array : * [status] => enum(failed, success) * [version] => string - example: 5.4.1-dev * [userEmail] => mangled @@ -36,27 +36,27 @@ * @param array releases we accept (so that we don't accept a report that claims to be PHP 8.1 for example) * @return boolean success or not (for the moment, error leads to a call to 'exit;' ... not good I know) */ -function insertToDb_phpmaketest($array, $QA_RELEASES = array()) +function insertToDb_phpmaketest($array, $QA_RELEASES = array()) { if (!is_array($array)) { // impossible to fetch data. We'll record this error later ... - + } else { - if (strtolower($array['status']) == 'failed') + if (strtolower($array['status']) == 'failed') $array['status'] = 0; - - elseif (strtolower($array['status']) == 'success') + + elseif (strtolower($array['status']) == 'success') $array['status'] = 1; - - else + + else die('status unknown: '.$array['status']); - + if (!is_valid_php_version($array['version'], $QA_RELEASES)) { exit('invalid version'); } - + $dbFile = dirname(__FILE__).'/db/'.$array['version'].'.sqlite'; - + $queriesCreate = array ( 'failed' => 'CREATE TABLE IF NOT EXISTS failed ( `id` integer PRIMARY KEY AUTOINCREMENT, @@ -88,8 +88,8 @@ function insertToDb_phpmaketest($array, $QA_RELEASES = array()) user_email varchar(64) default null )', ); - - + + if (!file_exists($dbFile)) { //Create DB $dbi = new SQLite3($dbFile, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE); @@ -103,10 +103,10 @@ function insertToDb_phpmaketest($array, $QA_RELEASES = array()) $dbi->close(); } $dbi = new SQLite3($dbFile, SQLITE3_OPEN_READWRITE) or exit('cannot open DB to record results'); - + // handle tests with no success if (!isset($array['succeededTest'])) $array['succeededTest'] = array(); - + $query = <<<'SQL' INSERT INTO `reports` ( `id`, `date`, `status`, `nb_failed`, `nb_expected_fail`, `success`, `build_env`, `phpinfo`, `user_email` @@ -138,7 +138,7 @@ SQL; foreach ($array['failedTest'] as $name) { if (substr($name, 0, 1) != '/') $name = '/'.$name; - + $test = $array['tests'][$name]; $query = <<<'SQL' INSERT INTO `failed` (`id`, `id_report`, `test_name`, `signature`, `output`, `diff`) @@ -154,9 +154,9 @@ SQL; if ($dbi->lastErrorCode() != '') { echo "ERROR when inserting failed test : ".$dbi->lastErrorMsg()."\n"; exit; - } + } } - + foreach ($array['expectedFailedTest'] as $name) { if (substr($name, 0, 1) != '/') $name = '/'.$name; $query = <<<'SQL' @@ -170,7 +170,7 @@ SQL; if ($dbi->lastErrorCode() != '') { echo "ERROR when inserting expected fail test : ".$dbi->lastErrorMsg()."\n"; exit; - } + } } foreach ($array['succeededTest'] as $name) { @@ -179,8 +179,8 @@ SQL; $stmt = $dbi->prepare($query); $stmt->bindValue(':name', $name, SQLITE3_TEXT); $res = $stmt->execute(); - - if ($res->numColumns() > 0) { + + if ($res->numColumns() > 0) { // hit ! do nothing atm } else { $query = <<<'SQL' @@ -190,16 +190,16 @@ SQL; $stmt = $dbi->prepare($query); $stmt->bindValue(':id_report', $reportId, SQLITE3_INTEGER); $stmt->bindValue(':test_name', $name, SQLITE3_TEXT); - + @$stmt->execute(); if ($dbi->lastErrorCode() != '') { echo "ERROR when inserting succeeded test : ".$dbi->lastErrorMsg()."\n"; exit; - } + } } } $dbi->close(); - + // remove cache if (file_exists($dbFile.'.cache')) unlink($dbFile.'.cache'); @@ -208,7 +208,7 @@ SQL; } /** - * Parse raw data from 'make test' and create array + * Parse raw data from 'make test' and create array * suitable to function insertToDb_phpmaketest() * * @param $version string PHP version (extracted from GET in buildtest-process.php \ @@ -223,12 +223,12 @@ function parse_phpmaketest($version, $status=null, $file) $extract = array(); $extract['version'] = $version; - + if (in_array($status, array('failed', 'success', 'unknown'))) $extract['status'] = $status; else $extract['status'] = null; - + $extract['userEmail'] = null; $extract['date'] = time(); @@ -249,32 +249,32 @@ function parse_phpmaketest($version, $status=null, $file) if (preg_match('@^={5,}@', $row) && $currentPart != 'phpinfo' && $currentPart != 'buildEnvironment') { // ======= $currentPart = ''; - + } elseif ($currentPart == '' && trim($row) == 'FAILED TEST SUMMARY') { - $currentPart = 'failedTest'; - + $currentPart = 'failedTest'; + } elseif ($currentPart == '' && trim($row) == 'EXPECTED FAILED TEST SUMMARY') { $currentPart = 'expectedFailedTest'; - + } elseif ($currentPart == '' && trim($row) == 'BUILD ENVIRONMENT') { $currentPart = 'buildEnvironment'; $currentTest = ''; - + } elseif (trim($row) == 'PHPINFO') { $currentPart = 'phpinfo'; $currentTest = ''; - + } elseif ($currentPart == 'failedTest' || $currentPart == 'expectedFailedTest') { preg_match('@(?<!via) \[([^\]]{1,})\]\s*(?:$|XFAIL)@', $row, $tab); if (count($tab) == 2) - if (!isset($extract[$currentPart]) || !in_array($tab[1], $extract[$currentPart])) + if (!isset($extract[$currentPart]) || !in_array($tab[1], $extract[$currentPart])) $extract[$currentPart][] = $tab[1]; - + } elseif ($currentPart == 'buildEnvironment') { if (preg_match('@User\'s E-mail: (.*)$@', $row, $tab)) { //User's E-mail $extract['userEmail'] = trim($tab[1]); - + if ($extract['userEmail'] == 'ciqa') { //reserved value ! $extract['userEmail'] = ''; @@ -283,21 +283,21 @@ function parse_phpmaketest($version, $status=null, $file) if (!isset($extract[$currentPart])) $extract[$currentPart] = ''; $extract[$currentPart] .= $row."\n"; - + } elseif ($currentPart == 'phpinfo') { if (!isset($extract[$currentPart])) $extract[$currentPart] = ''; $extract[$currentPart] .= $row."\n"; - + } elseif (substr(trim($row), -5) == '.phpt') { $currentTest = trim($row); continue; } if ($currentPart == '' && $currentTest != '') { - if (!isset($extract['outputsRaw'][$currentTest])) + if (!isset($extract['outputsRaw'][$currentTest])) $extract['outputsRaw'][$currentTest] = ''; $extract['outputsRaw'][$currentTest] .= $row."\n"; - + } } // 2nd try to cleanup name @@ -328,14 +328,14 @@ function parse_phpmaketest($version, $status=null, $file) $diff = ''; $startDiff = false; $output = explode("\n", $output); - + foreach ($output as $row) { if (preg_match('@^={5,}(\s)?$@', $row)) { if ($outputTest != '') $startDiff = true; - + } elseif ($startDiff === false) { $outputTest .= $row."\n"; - + } elseif (preg_match('@^[0-9]{1,}@', $row)) { $diff .= $row."\n"; } @@ -359,6 +359,6 @@ function parse_phpmaketest($version, $status=null, $file) else $extract['status'] = 'success'; } - + return $extract; } diff --git a/reports/reportsfunctions.php b/reports/reportsfunctions.php index 2c42f3d..9b7ec1e 100644 --- a/reports/reportsfunctions.php +++ b/reports/reportsfunctions.php @@ -86,7 +86,7 @@ class specificVersionFilterIterator extends WhitelistedFilterIterator public function __construct(Traversable $inner, $keyword) { parent::__construct($inner, array()); - if (!is_array($keyword)) + if (!is_array($keyword)) $this->keyword = array($keyword); else $this->keyword = $keyword; @@ -133,10 +133,10 @@ function get_summary_data($mode = QA_REPORT_FILTER_ALL) $data = array(); $it = new QaReportIterator(new DirectoryIterator(__DIR__.'/db/')); - + // temp fix $it = new specificVersionFilterIterator($it, array('5.3.99-dev', '5.4.0-dev')); - + if ($mode & QA_REPORT_FILTER_ALPHA) { $it = new keywordFilterIterator($it, 'alpha', $QA_RELEASES['reported']); } @@ -155,10 +155,10 @@ function get_summary_data($mode = QA_REPORT_FILTER_ALL) foreach ($it as $version => $database_file) { - if (!file_exists($database_file.'.cache') || + if (!file_exists($database_file.'.cache') || !($dataSerialize = unserialize(file_get_contents($database_file.'.cache')))) { - $database = new SQLite3($database_file, SQLITE3_OPEN_READONLY); + $database = new SQLite3($database_file, SQLITE3_OPEN_READONLY); //retrieve data $query = $database->query( "SELECT COUNT(*) AS nbReports, MAX(`date`) AS lastReport FROM reports" @@ -167,7 +167,7 @@ function get_summary_data($mode = QA_REPORT_FILTER_ALL) die("An error occured when reading summary data from $version DB file."); $row = $query->fetchArray(SQLITE3_ASSOC); $data[$version] = $row; - + $query = $database->query( "select count(distinct test_name) as nbFailingTests, count(*) as nbFailures from failed" ); @@ -176,7 +176,7 @@ function get_summary_data($mode = QA_REPORT_FILTER_ALL) $row = $query->fetchArray(SQLITE3_ASSOC); $data[$version]['nbFailingTests'] = $row['nbFailingTests']; $data[$version]['nbFailures'] = $row['nbFailures']; - + $database->close(); // write cache data file_put_contents($database_file.'.cache', serialize($data[$version])); diff --git a/reports/run_tests.php b/reports/run_tests.php index b1a6ea0..4ec6442 100644 --- a/reports/run_tests.php +++ b/reports/run_tests.php @@ -124,7 +124,7 @@ function outputTestReportsForVersion(string $getVersion) { } } } - + $query = 'SELECT failed.test_name,COUNT(failed.id) as cpt,COUNT(DISTINCT failed.diff) as variations, datetime(reports.date) as date,success.id as success, r2.id as failedci FROM failed, reports LEFT JOIN success ON success.test_name=failed.test_name diff --git a/reports/sorttable.js b/reports/sorttable.js index 06a1c22..5234e09 100644 --- a/reports/sorttable.js +++ b/reports/sorttable.js @@ -3,19 +3,19 @@ version 2 7th April 2007 Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ - + Instructions: Download this file Add <script src="sorttable.js"></script> to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort - + Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ - + var stIsIE = /*@cc_on!@*/false; sorttable = { @@ -26,19 +26,19 @@ sorttable = { arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); - + if (!document.createElement || !document.getElementsByTagName) return; - + sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; - + forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); - + }, - + makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and @@ -49,9 +49,9 @@ sorttable = { } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - + if (table.tHead.rows.length != 1) return; // can't cope with two header rows - + // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, @@ -73,7 +73,7 @@ sorttable = { } delete sortbottomrows; } - + // work through each column and calculate its type headrow = table.tHead.rows[0].cells; for (var i=0; i<headrow.length; i++) { @@ -92,7 +92,7 @@ sorttable = { dean_addEvent(headrow[i],"click", function(e) { if (this.className.search(/\bsorttable_sorted\b/) != -1) { - // if we're already sorted by this column, just + // if we're already sorted by this column, just // reverse the table, which is quicker sorttable.reverse(this.sorttable_tbody); this.className = this.className.replace('sorttable_sorted', @@ -105,7 +105,7 @@ sorttable = { return; } if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { - // if we're already sorted by this column in reverse, just + // if we're already sorted by this column in reverse, just // re-reverse the table, which is quicker sorttable.reverse(this.sorttable_tbody); this.className = this.className.replace('sorttable_sorted_reverse', @@ -117,7 +117,7 @@ sorttable = { this.appendChild(sortfwdind); return; } - + // remove sorttable_sorted classes theadrow = this.parentNode; forEach(theadrow.childNodes, function(cell) { @@ -130,7 +130,7 @@ sorttable = { if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } sortrevind = document.getElementById('sorttable_sortrevind'); if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } - + this.className += ' sorttable_sorted'; sortfwdind = document.createElement('span'); sortfwdind.id = "sorttable_sortfwdind"; @@ -151,18 +151,18 @@ sorttable = { //sorttable.shaker_sort(row_array, this.sorttable_sortfunction); /* and comment out this one */ row_array.sort(this.sorttable_sortfunction); - + tb = this.sorttable_tbody; for (var j=0; j<row_array.length; j++) { tb.appendChild(row_array[j][1]); } - + delete row_array; }); } } }, - + guessType: function(table, column) { // guess the type of a column based on its first non-blank row sortfn = sorttable.sort_alpha; @@ -172,7 +172,7 @@ sorttable = { if (text.match(/^-?[�$�]?[\d,.]+%?$/)) { return sorttable.sort_numeric; } - // check for a date: dd/mm/yyyy or dd/mm/yy + // check for a date: dd/mm/yyyy or dd/mm/yy // can have / or . or - as separator // can be mm/dd as well possdate = text.match(sorttable.DATE_RE) @@ -195,17 +195,17 @@ sorttable = { } return sortfn; }, - + getInnerText: function(node) { // gets the text we want to use for sorting for a cell. // strips leading and trailing whitespace. // this is *not* a generic getInnerText function; it's special to sorttable. // for example, you can override the cell text with a customkey attribute. // it also gets .value for <input> fields. - + hasInputs = (typeof node.getElementsByTagName == 'function') && node.getElementsByTagName('input').length; - + if (node.getAttribute("sorttable_customkey") != null) { return node.getAttribute("sorttable_customkey"); } @@ -240,7 +240,7 @@ sorttable = { } } }, - + reverse: function(tbody) { // reverse the rows in a tbody newrows = []; @@ -252,14 +252,14 @@ sorttable = { } delete newrows; }, - + /* sort functions each sort function takes two parameters, a and b you are comparing a[0] and b[0] */ sort_numeric: function(a,b) { aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); + bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); if (isNaN(bb)) bb = 0; return aa-bb; }, @@ -298,7 +298,7 @@ sorttable = { if (dt1<dt2) return -1; return 1; }, - + shaker_sort: function(list, comp_func) { // A stable sort function to allow multi-level sorting of data // see: http://en.wikipedia.org/wiki/Cocktail_sort @@ -328,7 +328,7 @@ sorttable = { b++; } // while(swap) - } + } } /* ****************************************************************** diff --git a/reports/test-insert.php b/reports/test-insert.php index c1fd1a1..f985735 100644 --- a/reports/test-insert.php +++ b/reports/test-insert.php @@ -61,19 +61,19 @@ if (in_array('Zend/tests/bug48770_3.phpt', $array['expectedFailedTest'])) echo " else echo " <font color='red'>KO</font> \n"; printf("%-30s", "specific failedTest"); -if (in_array('ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt', $array['failedTest'])) +if (in_array('ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt', $array['failedTest'])) echo " <font color='green'>OK</font> \n"; else echo " <font color='red'>KO</font> \n"; printf("%-30s", "specific test diff"); $strlen = strlen($array['tests']['/tests/func/010.phpt']['diff']); -if (isset($array['tests']['/tests/func/010.phpt']['diff']) && $strlen >= 290 ) +if (isset($array['tests']['/tests/func/010.phpt']['diff']) && $strlen >= 290 ) echo " <font color='green'>OK size: ".$strlen." - optimal = 293</font> \n"; else echo " <font color='red'>KO (length: $strlen should be > 290)</font> \n"; printf("%-30s", "specific test output"); $strlen = strlen($array['tests']['/tests/func/010.phpt']['output']); -if (isset($array['tests']['/tests/func/010.phpt']['output']) && $strlen >= 165 ) +if (isset($array['tests']['/tests/func/010.phpt']['output']) && $strlen >= 165 ) echo " <font color='green'>OK size: ".$strlen." - optimal = 167</font> \n"; else echo " <font color='red'>KO</font> \n"; @@ -82,7 +82,7 @@ if (strlen($array['phpinfo']) >= 27940) echo " <font color='green'>OK size: ".st else echo " <font color='red'>KO</font> \n"; printf("%-30s", "buildEnvironment"); -if (strlen($array['buildEnvironment']) >= 4500) +if (strlen($array['buildEnvironment']) >= 4500) echo " <font color='green'>OK size: ".strlen($array['buildEnvironment'])."</font> \n"; else echo " <font color='red'>KO</font> \n"; @@ -130,7 +130,7 @@ $query = 'SELECT * FROM reports WHERE user_email = \'thisisatestmail@testdomain. $q = $database->query($query); $sqlReport = $q->fetchArray(SQLITE3_ASSOC); printf("%-30s", "Found report in DB"); -if (is_array($sqlReport) && isset($sqlReport['id'])) +if (is_array($sqlReport) && isset($sqlReport['id'])) echo " <font color='green'>OK (id: ".$sqlReport['id'].")</font> \n"; else echo " <font color='red'>KO</font> \n"; @@ -147,8 +147,8 @@ while ($tab = $q->fetchArray(SQLITE3_ASSOC)) { printf("%-30s", "Found 33 failedTest"); if (count($sqlFailed) == 33) { echo " <font color='green'>OK</font> \n"; -} else { - echo " <font color='red'>KO (found: ".count($sqlFailed).")</font> \n"; +} else { + echo " <font color='red'>KO (found: ".count($sqlFailed).")</font> \n"; var_dump($sqlFailed); } @@ -160,21 +160,21 @@ list($nbExpected) = $q->fetchArray(); printf("%-30s", "Found 17 expectedFailedTests"); if ($nbExpected == 17) { echo " <font color='green'>OK</font> \n"; -} else { - echo " <font color='red'>KO (found: ".$nbExpected.")</font> \n"; +} else { + echo " <font color='red'>KO (found: ".$nbExpected.")</font> \n"; } printf("%-30s", "specific test diff"); $strlen = strlen($sqlFailed['/tests/func/010.phpt']['diff']); -if (isset($sqlFailed['/tests/func/010.phpt']['diff']) && $strlen >= 290 ) +if (isset($sqlFailed['/tests/func/010.phpt']['diff']) && $strlen >= 290 ) echo " <font color='green'>OK size: ".$strlen." - optimal = 293</font> \n"; else echo " <font color='red'>KO</font> \n"; printf("%-30s", "specific test output"); $strlen = strlen($sqlFailed['/tests/func/010.phpt']['output']); -if (isset($sqlFailed['/tests/func/010.phpt']['output']) && $strlen >= 165 ) +if (isset($sqlFailed['/tests/func/010.phpt']['output']) && $strlen >= 165 ) echo " <font color='green'>OK size: ".$strlen." - optimal = 167</font> \n"; else echo " <font color='red'>KO</font> \n"; diff --git a/reports/todo.txt b/reports/todo.txt index b71ea6d..0f113a9 100644 --- a/reports/todo.txt +++ b/reports/todo.txt @@ -1,5 +1,5 @@ Reports per week : -SELECT VERSION,COUNT(id), YEAR(DATE),WEEK(DATE) FROM reports +SELECT VERSION,COUNT(id), YEAR(DATE),WEEK(DATE) FROM reports GROUP BY VERSION,YEAR(DATE),WEEK(DATE) If we have time : graph to see reports sent by version and by date diff --git a/reports/viewreports.php b/reports/viewreports.php index 19282f0..21be35e 100644 --- a/reports/viewreports.php +++ b/reports/viewreports.php @@ -92,7 +92,7 @@ common_header(); <script src="sorttable.js"></script> <div style="margin:10px"> <h1><a href="/reports/"> -<img title="Go back home" src="home.png" border="0" +<img title="Go back home" src="home.png" border="0" style="vertical-align:middle;" /></a> <?php echo 'Test: '.$testName.' - Version '.$version.' '; @@ -163,8 +163,8 @@ if ($count === 1) { <br /><br /> <style> .diffClass { - overflow: auto; - max-height: 200px; + overflow: auto; + max-height: 200px; max-width: 100%; border: 1px solid #c0c0c0; padding-left: 5px; @@ -202,20 +202,20 @@ foreach ($allDiffArray as $diff) { foreach ($diffExploded as $line) { if (preg_match('@([0-9]{2,})(\-{1}) @', $line)) { echo '<div class="diffminus">'.htmlentities($line).'</div>'."\n"; - + } elseif (preg_match('@[0-9]{2,}[\+]{1,} @', $line)) { echo '<div class="diffplus">'.htmlentities($line).'</div>'."\n"; - + } else { // Should not happen. But print it anyway echo $line; } } echo '</div></td>'."\n "; - + // Complete output will be available in the future (present in DB file) //echo '<td width="80" align="center"><a href="#">View complete output</a></td>'; - + echo '</tr>'."\n"; echo '<tr><td colspan="2" style="background-color: #c0c0c0;height:1px"></td></tr>'; $i++; diff --git a/running-tests.php b/running-tests.php index f3dd44f..c7e9fb5 100644 --- a/running-tests.php +++ b/running-tests.php @@ -14,28 +14,28 @@ common_header(); <p> When <code>make test</code> finished running tests, and if there are any - failed tests, the script asks to send the logs to the PHP QA mailinglist. - Please answer "y" to this question so that we can efficiently process the results, + failed tests, the script asks to send the logs to the PHP QA mailinglist. + Please answer "y" to this question so that we can efficiently process the results, entering your e-mail address (which will not be transmitted in plaintext to any list) - enables us to ask you some more information if a test failed. Note that this script + enables us to ask you some more information if a test failed. Note that this script also uploads php -i output so your hostname may be transmitted. </p> <p> - Specific tests can also be executed, like running tests for a certain extension. To do - this you can do like so (for example the standard library): - <code>make test TESTS=ext/standard</code>. Where <code>TESTS=</code> points to a - directory containing <code>.phpt</code> files or a single <code>.phpt</code> file like: - <code>make test TESTS=tests/basic/001.phpt</code>. You can also pass options directly - to the underlaying script that runs the test suite (<code>run-tests.phpt</code>) using - <code>TESTS=</code>, for example to check for memory leaks using Valgrind, the <code>-m</code> - option can be passed along: <code>make test TESTS="-m Zend/"</code>. For a full list + Specific tests can also be executed, like running tests for a certain extension. To do + this you can do like so (for example the standard library): + <code>make test TESTS=ext/standard</code>. Where <code>TESTS=</code> points to a + directory containing <code>.phpt</code> files or a single <code>.phpt</code> file like: + <code>make test TESTS=tests/basic/001.phpt</code>. You can also pass options directly + to the underlaying script that runs the test suite (<code>run-tests.phpt</code>) using + <code>TESTS=</code>, for example to check for memory leaks using Valgrind, the <code>-m</code> + option can be passed along: <code>make test TESTS="-m Zend/"</code>. For a full list of options that can be passed along, then run <code>make test TESTS=-h</code>. </p> <p> - <strong>Windows users:</strong> On Windows the make command is called <code>nmake</code> - instead of <code>make</code>. This means that on Windows you will have to run + <strong>Windows users:</strong> On Windows the make command is called <code>nmake</code> + instead of <code>make</code>. This means that on Windows you will have to run <code>nmake test</code>, to run the test suite. </p> <?php diff --git a/sample_tests/clean.php b/sample_tests/clean.php index aa93041..97870ab 100644 --- a/sample_tests/clean.php +++ b/sample_tests/clean.php @@ -18,7 +18,7 @@ $imap_stream = imap_open($default_mailbox, $username, $password); // delete all msgs in default mailbox, i.e INBOX $check = imap_check($imap_stream); for ($i = 1; $i <= $check->Nmsgs; $i++) { - imap_delete($imap_stream, $i); + imap_delete($imap_stream, $i); } $mailboxes = imap_getmailboxes($imap_stream, $server, '*'); @@ -26,14 +26,14 @@ $mailboxes = imap_getmailboxes($imap_stream, $server, '*'); foreach($mailboxes as $value) { // Only delete mailboxes with our prefix if (preg_match('/\{.*?\}INBOX\.(.+)/', $value->name, $match) == 1) { - if (strlen($match[1]) >= strlen($mailbox_prefix) + if (strlen($match[1]) >= strlen($mailbox_prefix) && substr_compare($match[1], $mailbox_prefix, 0, strlen($mailbox_prefix)) == 0) { imap_deletemailbox($imap_stream, $value->name); } - } + } } -imap_close($imap_stream, CL_EXPUNGE); +imap_close($imap_stream, CL_EXPUNGE); ?></pre> <p>Back to "<a href="../phpt_details.php">PHPT Test File Layout</a>"</p> </div> diff --git a/sample_tests/sample005.php b/sample_tests/sample005.php index 5ccead7..13ce337 100644 --- a/sample_tests/sample005.php +++ b/sample_tests/sample005.php @@ -13,9 +13,9 @@ common_header(); <pre>--TEST-- SOAP Server 19: compressed request (gzip) --SKIPIF-- -<?php +<?php if (php_sapi_name()=='cli') echo 'skip'; - require_once('<a href="skipif2.php">skipif2.inc</a>'); + require_once('<a href="skipif2.php">skipif2.inc</a>'); if (!extension_loaded('zlib')) die('skip zlib extension not available'); ?> --INI-- diff --git a/sample_tests/sample007.php b/sample_tests/sample007.php index f7916f9..fea70dc 100644 --- a/sample_tests/sample007.php +++ b/sample_tests/sample007.php @@ -13,9 +13,9 @@ common_header(); <pre>--TEST-- SOAP Server 20: compressed request (deflate) --SKIPIF-- -<?php +<?php if (php_sapi_name()=='cli') echo 'skip'; - require_once('<a href="skipif2.php">skipif2.inc</a>'); + require_once('<a href="skipif2.php">skipif2.inc</a>'); if (!extension_loaded('zlib')) die('skip zlib extension not available'); ?> --INI-- diff --git a/sample_tests/sample008.php b/sample_tests/sample008.php index cfb551a..a90a0f9 100644 --- a/sample_tests/sample008.php +++ b/sample_tests/sample008.php @@ -11,7 +11,7 @@ common_header(); <h1>Sample Test: sample008.phpt</h1> <p>Back to "<a href="../phpt_details.php">PHPT Test File Layout</a>"</p> <pre>--TEST-- -GET/POST/REQUEST Test with input_filter +GET/POST/REQUEST Test with input_filter --SKIPIF-- <?php if (!extension_loaded("filter")) die("skip"); ?> --POST-- diff --git a/sample_tests/sample022.php b/sample_tests/sample022.php index b3f5115..746875d 100644 --- a/sample_tests/sample022.php +++ b/sample_tests/sample022.php @@ -40,7 +40,7 @@ $key = ftok(dirname(__FILE__)."/003.phpt", 'q'); $s = shm_attach($key); shm_remove($s); ?> ---EXPECTF-- +--EXPECTF-- Warning: shm_detach() expects exactly 1 parameter, 0 given in %ssample022.php on line %d NULL diff --git a/sample_tests/sample025.php b/sample_tests/sample025.php index 1c32d1d..4e65ac0 100644 --- a/sample_tests/sample025.php +++ b/sample_tests/sample025.php @@ -11,9 +11,9 @@ common_header(); <h1>Sample Test: sample025.phpt</h1> <p>Back to "<a href="../phpt_details.php">PHPT Test File Layout</a>"</p> <pre>--TEST-- -Test imap_append() function : basic functionality +Test imap_append() function : basic functionality --SKIPIF-- -<?php +<?php require_once(dirname(__FILE__).'/skipif.inc'); ?> --FILE-- @@ -34,7 +34,7 @@ if (!is_resource($imap_stream)) { } $mb_details = imap_mailboxmsginfo($imap_stream); -echo "Add a couple of msgs to new mailbox " . $mb_details->Mailbox . "\n"; +echo "Add a couple of msgs to new mailbox " . $mb_details->Mailbox . "\n"; var_dump(imap_append($imap_stream, $mb_details->Mailbox , "From: webmas...@something.com\r\n" . "To: i...@something.com\r\n" @@ -42,15 +42,15 @@ var_dump(imap_append($imap_stream, $mb_details->Mailbox . "\r\n" . "this is a test message, please ignore\r\n" )); - + var_dump(imap_append($imap_stream, $mb_details->Mailbox , "From: webmas...@something.com\r\n" . "To: i...@something.com\r\n" . "Subject: Another test\r\n" . "\r\n" . "this is another test message, please ignore it too!!\r\n" - )); - + )); + $check = imap_check($imap_stream); echo "Msg Count after append : ". $check->Nmsgs . "\n"; @@ -60,7 +60,7 @@ var_dump(imap_headers($imap_stream)); imap_close($imap_stream); ?> --CLEAN-- -<?php +<?php require_once('clean.inc'); ?> --EXPECTF-- diff --git a/write-test.php b/write-test.php index f83e6c1..10dcfa7 100644 --- a/write-test.php +++ b/write-test.php @@ -19,45 +19,45 @@ common_header(); ?> <h1>Creating new test files</h1> <h2><a name="tests-basics" href="#tests-basics" class="anchor">#</a>phpt Test Basics</h2> -<p> The first thing you need to know about tests is that we need more!!! Although PHP works just great +<p> The first thing you need to know about tests is that we need more!!! Although PHP works just great 99.99% of the time, not having a very comprehensive test suite means that we take more risks every time -we add to or modify the PHP implementation. The second -thing you need to know is that if you can write PHP you can write tests. Thirdly - we are a friendly +we add to or modify the PHP implementation. The second +thing you need to know is that if you can write PHP you can write tests. Thirdly - we are a friendly and welcoming community, don't be scared about writing to (<a href="mailto:php-qa@lists.php.net">php-qa@lists.php.net</a>) - we won't bite! </p> <ul> <li> - <b>So what are phpt tests?</b> - <p>A phpt test is a little script used by the php internal and quality -assurance teams to test PHP's functionality. It can be used with new releases to make -sure they can do all the things that previous releases can, or to help find bugs in current + <b>So what are phpt tests?</b> + <p>A phpt test is a little script used by the php internal and quality +assurance teams to test PHP's functionality. It can be used with new releases to make +sure they can do all the things that previous releases can, or to help find bugs in current releases. By writing phpt tests you are helping to make PHP more stable.</p> </li> <li> - <b>What skills are needed to write a phpt test?</b> - <p>All that is really needed to write a phpt test + <b>What skills are needed to write a phpt test?</b> + <p>All that is really needed to write a phpt test is a basic understanding of the PHP language, a text editor, and a way to get the results -of your code. That is it. So if you have been writing and running PHP scripts already - +of your code. That is it. So if you have been writing and running PHP scripts already - you have everything you need.</p> </li> <li> - <b>What do you write phpt tests on?</b> - <p>Basically you can write a phpt test on one of the various -php functions available. You can write a test on a basic language function (a string -function or an array function) , or a function provided by one of PHP's numerous extensions + <b>What do you write phpt tests on?</b> + <p>Basically you can write a phpt test on one of the various +php functions available. You can write a test on a basic language function (a string +function or an array function) , or a function provided by one of PHP's numerous extensions (a mysql function or a image function or a mcrypt function).</p> -<p>You can find out what functions already have phpt tests by looking in the <a href="http://git.php.net/?p=php-src.git;a=tree;">html +<p>You can find out what functions already have phpt tests by looking in the <a href="http://git.php.net/?p=php-src.git;a=tree;">html version</a> of the git repository (ext/standard/tests/ is a good place to start looking - though not -<i>all</i> the tests currently written are in there). If you look at the <a href="http://gcov.php.net">gcov pages</a> you +<i>all</i> the tests currently written are in there). If you look at the <a href="http://gcov.php.net">gcov pages</a> you can see which functions have lots of tests and which need more, although these pages only -show which lines of code are covered by test cases so even if the coverage looks good there may +show which lines of code are covered by test cases so even if the coverage looks good there may be more interesting tests to write - for example covering error cases.</p> <p> - You can find a list of functionality coverage on GCOV for the following, active branches: + You can find a list of functionality coverage on GCOV for the following, active branches: <ul style="list-style-type: square;"> <?php @@ -70,15 +70,15 @@ be more interesting tests to write - for example covering error cases.</p> </ul> </p> <p>If you want more guidance than that you can always ask -the PHP Quality Assurance Team on their mailing list -(<a href="mailto:php-qa@lists.php.net">php-qa@lists.php.net</a>) where they +the PHP Quality Assurance Team on their mailing list +(<a href="mailto:php-qa@lists.php.net">php-qa@lists.php.net</a>) where they would like you to direct your attentions.</p> </li> <li> - <b>How is a phpt test is used?</b> - <p>When a test is called by the run-tests.php script it takes various -parts of the phpt file to name and create a .php file. That .php file is then executed. The + <b>How is a phpt test is used?</b> + <p>When a test is called by the run-tests.php script it takes various +parts of the phpt file to name and create a .php file. That .php file is then executed. The output of the .php file is then compared to a different section of the phpt file. If the output of the script "matches" the output provided in the phpt script - it passes.</p> </li> @@ -114,21 +114,21 @@ test is for. Tests should be named according to the following list: <extname><no>.phpt (dba_003.phpt)</li> </ul> </p> -<p> The convention of using _basic, _error and _variation was introduced when we -found that writing a single test case for each function resulted in unacceptably large +<p> The convention of using _basic, _error and _variation was introduced when we +found that writing a single test case for each function resulted in unacceptably large test cases. It's quite hard to debug problems when the test case generates 100s of lines of output. -<p>The "basic" test case for a function should just address the single most simple -thing that the function is designed to do. For example, if writing a test for the sin() function +<p>The "basic" test case for a function should just address the single most simple +thing that the function is designed to do. For example, if writing a test for the sin() function a basic test would just be to check that sin() returns the correct values for some known angles - eg 30, 90, 180. </p> -<p>The "error" tests for a function are test cases which are designed to provoke errors, warnings or notices. -There can be more than one error case, if so the convention is to name the test cases mytest_error1.phpt, +<p>The "error" tests for a function are test cases which are designed to provoke errors, warnings or notices. +There can be more than one error case, if so the convention is to name the test cases mytest_error1.phpt, mytest_error2.phpt and so on.<p> -<p>The "variation" tests are any tests that don't fit into "basic" or "error" tests. For example one might +<p>The "variation" tests are any tests that don't fit into "basic" or "error" tests. For example one might use a variation tests to test boundary conditions.</p> <h3><a name="howbig" href="#howbig" class="anchor">#</a>How big is a test case?</h3> -<p>Small. Really - the smaller the better, a good guide is no more than 10 lines of output. The reason +<p>Small. Really - the smaller the better, a good guide is no more than 10 lines of output. The reason for this is that if we break something in PHP and it breaks your test case we need to be able to find out quite quickly what we broke, going through 1000s of line of test case output is not easy. Having said that it's sometimes just not practical to stay within the 10 line guideline, in this case you can help a lot @@ -140,7 +140,7 @@ that we learnt over time, in fact we are slowly going through and splitting test obvious to you as you write it, but it might not be to someone looking at it later on</p> <h3><a name="basic-format" href="#basic-format" class="anchor">#</a>Basic Format</h3> -<p>A test must contain the sections TEST, FILE and either EXPECT or EXPECTF at a minimum. The example +<p>A test must contain the sections TEST, FILE and either EXPECT or EXPECTF at a minimum. The example below illustrates a minimal test.</p> <i>ext/standard/tests/strings/strtr.phpt</i> <pre> @@ -158,8 +158,8 @@ string(32) "# hello All, I sAid hi planet! #" <p>As you can see the file is divided into several sections. The TEST section holds a one line title of the phpt test, this shoudl be a simple description and shouldn't ever excede one line, if you need to write more explanation -add comments in the body of the test case. The phpt files name is used when generating a .php file. The FILE section is used -as the body of the .php file, so don't forget to open and close your php tags. The EXPECT section is +add comments in the body of the test case. The phpt files name is used when generating a .php file. The FILE section is used +as the body of the .php file, so don't forget to open and close your php tags. The EXPECT section is the part used as a comparison to see if the test passes. It is a good idea to generate output with var_dump() calls.</p> @@ -173,8 +173,8 @@ Look at the talk entitled "The need for speed, ERM testing".</p> <h3><a name="autogen-tests" href="#autogen-tests" class="anchor">#</a>Autogenerating test cases</h3> <p> It isn't possible (or even sensible) to try and generate complete test cases for PHP. However -there is a script in PHP5.3 which will help to generate the framework. It can save you -some typing and ensure that you get a good basic format. +there is a script in PHP5.3 which will help to generate the framework. It can save you +some typing and ensure that you get a good basic format. See <a href="autogenerate.php">test case generation</a> for instructions on how to use it.</p> @@ -226,17 +226,17 @@ of failures on other platforms. If you don't have karma to commit have a look at <p>When you are testing your test case it's <b>really</b> important to make sure that you clean up any temporary resources (eg files) that you used in the test. There is a special --CLEAN-- section to help you do this - see <a href="#clean">here</a>. -<p>Another good check is to look at what lines of code in the PHP source your test case covers. +<p>Another good check is to look at what lines of code in the PHP source your test case covers. This is easy to do, there are some instructions on the <a href="http://wiki.php.net/doc/articles/writing-tests">PHP Wiki</a>.</p> <h3><a name="whattodo" href="#whattodo" class="anchor">#</a>What should I do with my test case when I've written and tested it?</h3> <p>The next step is to get someone to review it. If it's short you can paste it into a note and -send it to php-qa@lists.php.net. If the test is a bit too -long for that then put it somewhere were people can download it (<a href="http://www.pastebin.ca/">pastebin</a> is +send it to php-qa@lists.php.net. If the test is a bit too +long for that then put it somewhere were people can download it (<a href="http://www.pastebin.ca/">pastebin</a> is sometimes used). Appending tests to notes as files doesn't work well - so please don't do that. Your -note to php-qa@lists.php.net should say -what level of PHP you have tested it on and what platform(s) you've run it on. Someone from -the PHP QA group will review your test and reply to you. They may ask for some changes +note to php-qa@lists.php.net should say +what level of PHP you have tested it on and what platform(s) you've run it on. Someone from +the PHP QA group will review your test and reply to you. They may ask for some changes or suggest better ways to do things, or they may commit it to PHP. @@ -257,7 +257,7 @@ use an appropriate PHP function to sort them befor printing. Both of these examples have affected PHP tests in the past.</p> <p>Make sure that any test touching parsing or display of dates uses a -hard-defined timezone - preferable 'UTC'. It is important tha this is defined in +hard-defined timezone - preferable 'UTC'. It is important tha this is defined in the file section using:</p> <pre> date_default_timezone_set('UTC'); @@ -277,7 +277,7 @@ platforms can use a SKIPIF section like:</p> <pre> --SKIPIF-- -<?php +<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); ?> </pre> @@ -286,7 +286,7 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only"); <pre> --SKIPIF-- -<?php +<?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); ?> </pre> @@ -295,7 +295,7 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); <pre> --SKIPIF-- -<?php +<?php if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only"); ?> </pre> @@ -304,7 +304,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms <pre> --SKIPIF-- -<?php +<?php if (!stristr(PHP_OS, "Linux")) die("skip this test is Linux platforms only"); ?> </pre> @@ -314,7 +314,7 @@ if (!stristr(PHP_OS, "Linux")) die("skip this test is Linux platforms only"); <pre> --SKIPIF-- -<?php +<?php if (!stristr(PHP_OS, "Darwin")) die("skip this test is for Mac OS X platforms only"); ?> </pre> @@ -322,10 +322,10 @@ if (!stristr(PHP_OS, "Darwin")) die("skip this test is for Mac OS X platforms on <h2><a name="examples" href="#examples" class="anchor">#</a>Examples</h2> <h3><a name="expectf" href="#expectf" class="anchor">#</a>EXPECTF</h3> -<p>/ext/standard/tests/strings/str_shuffle.phpt is a good example for using -EXPECTF instead of EXPECT. From time to time the algorithm used for shuffle -changed and sometimes the machine used to execute the code has influence -on the result of shuffle. But it always returns a three character string +<p>/ext/standard/tests/strings/str_shuffle.phpt is a good example for using +EXPECTF instead of EXPECT. From time to time the algorithm used for shuffle +changed and sometimes the machine used to execute the code has influence +on the result of shuffle. But it always returns a three character string detectable by %s (that matches any string until the end of the line). Other scan-able forms are %a for any amount of chars (at least one), %i for integers, %d for numbers only, %f for floating point values, %c for single characters, %x for @@ -350,9 +350,9 @@ string(3) "123" </pre> <h3><a name="expectregex" href="#expectregex" class="anchor">#</a>EXPECTREGEX</h3> -<p>/ext/standard/tests/strings/strings001.phpt is a good example for using -EXPECTREGEX instead of EXPECT. This test also shows that in EXPECTREGEX -some characters need to be escaped since otherwise they would be +<p>/ext/standard/tests/strings/strings001.phpt is a good example for using +EXPECTREGEX instead of EXPECT. This test also shows that in EXPECTREGEX +some characters need to be escaped since otherwise they would be interpreted as a regular expression.</p> <i>/ext/standard/tests/strings/strings001.phpt</i> @@ -372,8 +372,8 @@ string\(19\) \" nica\x00turska panica\" </pre> <h3><a name="skipif" href="#skipif" class="anchor">#</a>SKIPIF</h3> -<p>Some tests depend on modules or functions available only in certain versions -or they even require minimum version of php or zend. These tests should be +<p>Some tests depend on modules or functions available only in certain versions +or they even require minimum version of php or zend. These tests should be skipped when the requirement cannot be fulfilled. To achieve this you can use the SKIPIF section. To tell run-tests.php that your test should be skipped the SKIPIF section must print out the word "skip" followed by a reason why @@ -384,7 +384,7 @@ the test should skip.</p> --TEST-- Check for exif_read_data, unusual IFD start --SKIPIF-- -<?php +<?php if (!extension_loaded('exif')) print 'skip exif extension not available'; ?> --FILE-- @@ -404,16 +404,16 @@ array(2) { } </pre> -<p>Test script and SKIPIF code should be directly written into *.phpt. However, -it is recommended to use include files when more test scripts depend on the -same SKIPIF code or when certain test files need the same values for some +<p>Test script and SKIPIF code should be directly written into *.phpt. However, +it is recommended to use include files when more test scripts depend on the +same SKIPIF code or when certain test files need the same values for some input. </p> <p> -<b>Note:</b> no file used by any test should have one of the following extensions: +<b>Note:</b> no file used by any test should have one of the following extensions: ".php", ".log", ".mem", ".exp", ".out" or ".diff". When you use an include file for the -SKIPIF section it should be named "skipif.inc" and an include file used in the +SKIPIF section it should be named "skipif.inc" and an include file used in the FILE section of many tests should be named "test.inc".</p> <h2><a name="finalnotes" href="#finalnotes" class="anchor">#</a>Final Notes</h2> @@ -465,29 +465,29 @@ idea to avoid using extensions that are already used for other purposes, eg .inc that is clearly related to the test case. For example, mytest.phpt should create mytest.tmp (or mytestN.tmp, N=1, 2,3,...) then if by any chance the temporary file isnt't removed properly it will be obvious which test case created it.</p> -<p>When writing and debugging a test case with a --CLEAN-- section it is helpful to remember that the php code in the --CLEAN-- section -is executed separately from the code in the --FILE-- section. For example, in a test case called mytest.phpt, code from the --FILE-- -section is run from a file called mytest.php and code from the --CLEAN-- section is run from a file called mytest.clean.php. If the test passes, -both the .php and .clean.php files are removed by run-tests.php. You can prevent the removal by using the --keep option of run-tests.php, +<p>When writing and debugging a test case with a --CLEAN-- section it is helpful to remember that the php code in the --CLEAN-- section +is executed separately from the code in the --FILE-- section. For example, in a test case called mytest.phpt, code from the --FILE-- +section is run from a file called mytest.php and code from the --CLEAN-- section is run from a file called mytest.clean.php. If the test passes, +both the .php and .clean.php files are removed by run-tests.php. You can prevent the removal by using the --keep option of run-tests.php, this is a very useful option if you need to check that the --CLEAN-- section code is working as you intended. -<p> Finally - if you are using CVS it's helpful to add the extension that you use for test-related temporary files to the .cvsignore file - +<p> Finally - if you are using CVS it's helpful to add the extension that you use for test-related temporary files to the .cvsignore file - this will help to prevent you from accidentally checking temporary files into CVS. </p> <h3><a name="redirecting" href="#redirecting" class="anchor">#</a>Redirecting tests</h3> -<p>Using --REDIRECTTEST-- it is possible to redirect from one test to a bunch -of other tests. That way multiple extensions can refer to the same set of +<p>Using --REDIRECTTEST-- it is possible to redirect from one test to a bunch +of other tests. That way multiple extensions can refer to the same set of test scripts probably using it with a different configuration.</p> -<p>The block is eval'd and supposed to return an array describing how to -redirect. The resulting array must contain the key 'TEST' that stores the -redirect target as a string. This string usually is the directory where the -test scripts are located and should be relative. Optionally you can use -the 'ENV' as an array configuring the environment to be set when executing +<p>The block is eval'd and supposed to return an array describing how to +redirect. The resulting array must contain the key 'TEST' that stores the +redirect target as a string. This string usually is the directory where the +test scripts are located and should be relative. Optionally you can use +the 'ENV' as an array configuring the environment to be set when executing the tests. This way you can pass configuration to the executed tests. </p> -<p>Redirect tests may especially contain --SKIPIF--, --ENV-- and --ARGS-- +<p>Redirect tests may especially contain --SKIPIF--, --ENV-- and --ARGS-- sections but they no not use any --EXPECT-- section.</p> <p>The redirected tests themselves are just normal tests.</p> @@ -503,17 +503,17 @@ $php_errormsg variable, which you can then output. This will result in a consistent error message output across all platforms and PHP configurations, preventing your test from failing due inconsistencies in the error message content. Alternatively you can use --EXPECTF-- and check for the message by -replacing the path of the source of the message with "%s" and the line number -with "%d". The end of a message in a test file "example.phpt" then looks like -"in %sexample.php on line %d". We explicitly dropped the last path devider as +replacing the path of the source of the message with "%s" and the line number +with "%d". The end of a message in a test file "example.phpt" then looks like +"in %sexample.php on line %d". We explicitly dropped the last path devider as that is a system dependent character '/' or '\'.</p> <h3><a name="lastbit" href="#lastbit" class="anchor">#</a>Last bit</h3> <p>Often you want to run test scripts without run-tests.php by simply executing them on command line like any other php script. But sometimes -it disturbs having a long --EXPECT-- block, so that you don't see the actual +it disturbs having a long --EXPECT-- block, so that you don't see the actual output as it scrolls away overwritten by the blocks following the actual file -block. The workaround is to use terminate the --FILE-- section with the two +block. The workaround is to use terminate the --FILE-- section with the two lines "===DONE===" and "<?php exit(0); ?>. When doing so run-tests.php does not execute the line containing the exit call as that would suppress leak messages. Actually run-tests.php ignores any part @@ -521,7 +521,7 @@ after a line consisting only of "===DONE===".</p> <p>Here is an example:</p> <pre> --TEST-- -Test hypot() - dealing with mixed number/character input +Test hypot() - dealing with mixed number/character input --INI-- precision=14 --FILE-- @@ -538,7 +538,7 @@ precision=14 23abc :-33 float(40.224370722238) ===DONE=== </pre> -<p>If executed as PHP script the output will stop after the code on the --FILE-- section +<p>If executed as PHP script the output will stop after the code on the --FILE-- section has been run.</p> <p></p> <?php