David Fugate c26f761a9f tools\TestCaseHTMLPackager\TestCasePacker.ps1: there were some improvements made to this script WRT to the
processing of unicode-related test cases.

tools\TestCaseHTMLPackager\TestUpdater.ps1:  new script which preprocesses test cases (rips out comments,
etc.)

external\contributions\Microsoft\ietestcenter_ppb5\chapter11\11.4\11.4.1\11.4.1-4.a-10.js and
website\resources\scripts\testcases\chapter11\11.4\11.4.1\11.4.1-4.a-10.js:  cleaned up a code comment

website\enginereports\sample.xml: removed

website\resources\scripts\global\jquery-1.4.2.js:  removed

website\resources\scripts\*.ps1:  moved into the tools\ directory

website\Web.config:  removed.  This is only relevant for Windows-based hosting of test262

website\browserreport.html:  removed
2010-11-03 10:10:47 -07:00

53 lines
3.3 KiB
PowerShell
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

param($scriptsDir, $xmlFilename)
function GetFilename($FullPathName) {
$PIECES=$FullPathName.split(\)
$NUMBEROFPIECES=$PIECES.Count
$FILENAME=$PIECES[$NumberOfPieces-1]
return $FILENAME
}
function ReplaceScript([string]$scriptCode, [xml]$testList, [string]$testID){
$scriptCodeContent=""
foreach($line in $scriptCode){
$scriptCodeContent+=$line+"`r`n"
}
# remove comments
$hs5HarnessPos=$scriptCodeContent.IndexOf("ES5Harness")
$comments=$scriptCodeContent.Substring(0,$hs5HarnessPos)
$comments=$comments -replace "(//.*\n|/\*(.|\n)*?\*/)"
$scriptCodeContent=$scriptCodeContent.Substring($hs5HarnessPos)
$scriptCodeContent=[Convert]::ToBase64String($utf8Encoding.GetBytes($scriptCodeContent))
$a = $testListFile.testCollection.section.test | Where-Object { $_.id -match $testID}
$a.innerxml="<![CDATA["+$scriptCodeContent+"]]>"
}
$utf8Encoding = New-Object System.Text.UTF8Encoding
$testListFile=New-Object XML
$testListFile.load($xmlFilename)
if($scriptsDir.substring($scriptsDir.length-3,3) -match ".js") {
$scriptCode=Get-Content -Encoding UTF8 $scriptsDir
$testID = GetFilename $scriptsDir
ReplaceScript $scriptCode $testListFile $testID.TrimEnd(".js")
}
else {
$sourceFiles = get-childitem $scriptsDir -include *.js -recurse | where-object{$_.mode -notmatch "d"}
foreach($test in $sourceFiles){
$testName=$test.Name.Remove($test.Name.Length-3)
if($testName.length -gt 0) {
$scriptCode=Get-Content -Encoding UTF8 $test.FullName
ReplaceScript $scriptCode $testListFile $testName
}
}
}
$testListFile.Save($xmlFilename)