Example #1
0
                if (fileCmpSyntax($outFileFull, $etalonFileFull)) {
                    $successCnt++;
                    echo "{$inFile}...OK\n";
                } else {
                    $failedCnt++;
                    echo "{$inFile}...FAIL\n";
                }
            } else {
                if ($mode == 3) {
                    if (fileCmpSymbol($outFileFull, $etalonFileFull)) {
                        $successCnt++;
                        echo "{$inFile}...OK\n";
                    } else {
                        $failedCnt++;
                        echo "{$inFile}...FAIL\n";
                    }
                }
            }
        }
    }
    echo "SUCCESSED/FAILED/UNKNOWN\n";
    echo "{$successCnt}/{$failedCnt}/{$unknownCnt}\n";
}
//argv = [0, in_dir, out_dir, etalon_dir, mode]
//mode: 1 -> lex
//      2 -> syntax
//      3 -> tables
testAll($argv[1], $argv[2], $argv[3], $argv[4]);
if ($argv[4] == 2) {
    genHtml($argv[1], $argv[2]);
}
<!-- END -->
</table>
<br>
</fieldset>
<br>

<?php 
if (isset($_POST['appKey'])) {
    // Let's display what's been provided for Form data so we can see what will be passed
    //	to the HTTP client interface
    echo "<fieldset><legend>Response Data</legend>\r\n\t\t\t<table border=1 width=80%>\r\n\t\t\t<tr><td colspan=2>Submitted Data</td></tr>\r\n\t\t\t<tr><td>App ID</td><td>{$appId}</td></tr>\r\n\t\t\t<tr><td>App Key</td><td>{$appKey}</td></tr>\r\n\t\t\t<tr><td>Device ID</td><td>{$deviceId}</td></tr>\r\n\t\t\t<tr><td>Voice</td><td>{$voice}</td></tr>\r\n\t\t\t<tr><td>Language</td><td>{$language}</td></tr>\r\n\t\t\t<tr><td>Selection</td><td>{$selection}</td></tr>\r\n\t\t\t<tr><td>Codec</td><td>{$codec}</td></tr>\r\n\t\t\t<tr><td>Text</td><td>{$text}</td></tr>\r\n\t\t\t</table><br>";
    /*
     * If 'Test All Voices' or 'Test All Languages' is selected, call testAll to loop through the list
     */
    if ($selection == 'voice' && $voice == 'Test All Voices' || $selection == 'language' && $language == 'Test All Languages') {
        testAll($selection, $appId, $appKey, $deviceId, $codec, $text);
    } else {
        if ($selection == 'voice') {
            // We want to make sure we grab the correct language so we build the audio
            // filename properly.
            $language = findLanguageCode($voice);
        }
        $url = buildRequestString($selection, $appId, $appKey, $deviceId, $voice, $language, $codec, $text);
        $m = executeTtsRequest($url);
        processResults($m, $language, $voice);
    }
    echo "</fieldset>";
}
?>

</div>