mirror of https://github.com/tc39/test262.git
Merged
This commit is contained in:
commit
b9bd140cef
|
@ -22,7 +22,8 @@
|
|||
|
||||
//An exception is expected
|
||||
if (testDescrip.negative !== undefined) {
|
||||
testDescrip.negative = testDescrip.negative !== "" ? testDescrip.negative : ".";
|
||||
//TODO - come up with a generic way of catching the error type from window.onerror
|
||||
testDescrip.negative = testDescrip.negative === "NotEarlyError" ? testDescrip.negative : ".";
|
||||
if (window.iframeError === undefined) { //no exception was thrown
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
|
||||
'fail',
|
||||
|
|
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="LogFileDirectory" value="."/>
|
||||
<add key="InputXMLPath" value=".\InputFormats.xml"/>
|
||||
<add key="BasicInputTemplate" value=".\testTemplate.js"/>
|
||||
<add key="BasicPrereqInputTemplate" value=".\testPrereqTemplate.js"/>
|
||||
<add key="BasicNegativeInputTemplate" value=".\testNegativeTemplate.js"/>
|
||||
<add key="BasicNegativePrereqInputTemplate" value=".\testNegativePrereqTemplate.js"/>
|
||||
<add key="CommentsRegex" value="^@[a-zA-Z0-9]*(:\s*.*;{1})?$"/>
|
||||
<add key="ChecksRegex" value=".\s*CHECK#[0-9].\s*"/>
|
||||
<add key="GlobalCodeRegex" value="\*/[\r\n]*.*"/>
|
||||
</appSettings>
|
||||
</configuration>
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||
<Class Name="Microsoft.Sputnik.Interop.ParserEngine.Program" Collapsed="true">
|
||||
<Position X="0.5" Y="0.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAA=</HashCode>
|
||||
<FileName>Program.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Microsoft.Sputnik.Interop.ParserEngine.SputnikTestScript">
|
||||
<Position X="4" Y="1.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAgAAAAAAgiAAAAgAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>SputnikTestCase.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="Microsoft.Sputnik.Interop.ParserEngine.ES5TestScript">
|
||||
<Position X="6.25" Y="1.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||
<FileName>ES5TestCase.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
|
@ -1,228 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
|
||||
//this version has been modified to not split each #check into an individual test
|
||||
|
||||
namespace Microsoft.Sputnik.Interop.ParserEngine
|
||||
{
|
||||
public static class ES5TestScript
|
||||
{
|
||||
private static int fileCounter;
|
||||
private static StringBuilder negativeTestCases;
|
||||
private static string globalScopeFileName = "\\SputnikGlobalScope.js";
|
||||
|
||||
|
||||
private static string[] templates = {
|
||||
|
||||
|
||||
ES5TestScript.GetTemplateFile(ResourceClass.BasicTemplate_FileName),
|
||||
ES5TestScript.GetTemplateFile(ResourceClass.BasicPrereqTemplate_FileName),
|
||||
ES5TestScript.GetTemplateFile(ResourceClass.BasicNegativeTemplate_FileName),
|
||||
ES5TestScript.GetTemplateFile(ResourceClass.BasicNegativePrereqTemplate_FileName)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Output files counter
|
||||
/// </summary>
|
||||
public static int OutputFileCounter
|
||||
{
|
||||
get
|
||||
{
|
||||
return fileCounter;
|
||||
}
|
||||
set
|
||||
{
|
||||
fileCounter = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Method to save the sputnik scripts in ES5 format
|
||||
/// </summary>
|
||||
/// <param name="script">SputnikTestScript Object which will have all the details to be written to the file</param>
|
||||
/// <param name="destinationPath">Is the destination folder path</param>
|
||||
public static void Save(SputnikTestScript script, string root, string destinationPath)
|
||||
{
|
||||
string destDir = Path.Combine(destinationPath, Path.GetDirectoryName(script.pathFromRoot));
|
||||
string buildContent = string.Empty;
|
||||
string destFullPath = string.Empty;
|
||||
string preCondition = string.IsNullOrEmpty(script.PreConditionCode) ? String.Empty : script.PreConditionCode;
|
||||
int templateIndex = string.IsNullOrEmpty(preCondition) ? 0 : 1;
|
||||
string body = script.Body;
|
||||
if (script.IsNegative)
|
||||
{
|
||||
templateIndex += 2;
|
||||
}
|
||||
string template = templates[templateIndex];
|
||||
Logger.WriteToLog("=====================================================================================");
|
||||
Logger.WriteToLog("Source file={0}\n", script.FullPath);
|
||||
Logger.WriteToLog("Destination(s)=");
|
||||
if (script.id == "")
|
||||
{
|
||||
Console.Write(script.Header);
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
string[] args = { script.Header, script.id, script.path.Replace("\\", "/"), InsertStringEscapes(script.assertion), InsertStringEscapes(script.description), script.ReplicationCode, body, preCondition, script.InitialComment };
|
||||
destFullPath = Path.Combine(destDir, string.Format(@"{0}.js", script.id));
|
||||
|
||||
try
|
||||
{
|
||||
buildContent = string.Format(template, args);
|
||||
string dirPath = Path.GetDirectoryName(destFullPath);
|
||||
if (!Directory.Exists(dirPath))
|
||||
Directory.CreateDirectory(dirPath);
|
||||
using (TextWriter writeTestCase = File.CreateText(destFullPath))
|
||||
{
|
||||
writeTestCase.WriteLine(buildContent);
|
||||
writeTestCase.Flush();
|
||||
writeTestCase.Close();
|
||||
OutputFileCounter++;
|
||||
}
|
||||
|
||||
if (script.IsNegative)
|
||||
{
|
||||
//Add details in stringbuilder.
|
||||
StringBuilder sb = new StringBuilder();
|
||||
//sb.Append("GlobalScopeTests[script.pathFromRoot.Replace("\\", "/") + "\"]");
|
||||
sb.Append("GlobalScopeTests[\"" + script.id + "\"]");
|
||||
sb.Append("=");
|
||||
string s = GetSerializedSputnikTestScript(new SputnikTestScript()
|
||||
{
|
||||
id = script.id,
|
||||
path = script.path,
|
||||
description = script.description,
|
||||
assertion = script.assertion,
|
||||
});
|
||||
sb.Append(s.Substring(0, s.LastIndexOf('}')) + ",\"negative\":\".\"};");
|
||||
|
||||
if (negativeTestCases == null)
|
||||
{
|
||||
negativeTestCases = new StringBuilder();
|
||||
}
|
||||
else
|
||||
{
|
||||
negativeTestCases.Append("\n");
|
||||
}
|
||||
negativeTestCases.Append(sb.ToString());
|
||||
}
|
||||
|
||||
Logger.WriteToLog(destFullPath);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
Logger.WriteToLog(ResourceClass.IOException, ex.Message);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Logger.WriteToLog(ResourceClass.IOException, ex.Message);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to initialize the negative test record.
|
||||
/// </summary>
|
||||
/// <param name="destination">Is the destination folder path</param>
|
||||
public static void InitGlobals(string destination)
|
||||
{
|
||||
//Insert inital var name in Globals.js file.
|
||||
if (!Directory.Exists(destination))
|
||||
{
|
||||
Directory.CreateDirectory(destination);
|
||||
}
|
||||
FileStream fs = new FileStream(destination.Remove(destination.LastIndexOf("\\")) + globalScopeFileName, FileMode.Create, FileAccess.Write);
|
||||
StreamWriter sw = new StreamWriter(fs);
|
||||
sw.Write("this.GlobalScopeTests = this.GlobalScopeTests || {};\n");
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
fs.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to update the SputnikGlobalScope.js
|
||||
/// </summary>
|
||||
/// <param name="destination">Is the destination folder path</param>
|
||||
public static void UpdateGlobals(string destination)
|
||||
{
|
||||
//Replace the last comma by closing curly brace and semi-colon.
|
||||
File.AppendAllText(destination.Remove(destination.LastIndexOf("\\")) + globalScopeFileName, negativeTestCases.ToString());
|
||||
negativeTestCases.Clear();
|
||||
}
|
||||
|
||||
|
||||
private static string GetSerializedSputnikTestScript(SputnikTestScript sputnikTestScript)
|
||||
{
|
||||
MemoryStream stream = new MemoryStream();
|
||||
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(SputnikTestScript));
|
||||
ser.WriteObject(stream, sputnikTestScript);
|
||||
|
||||
stream.Position = 0;
|
||||
StreamReader sr = new StreamReader(stream);
|
||||
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
|
||||
private static string WrapWithEval(string s)
|
||||
{
|
||||
return InsertStringEscapes(s, true);
|
||||
}
|
||||
|
||||
private static string InsertStringEscapes(string s, bool wrapWithEval = false)
|
||||
{
|
||||
StringReader rdr = new StringReader(s);
|
||||
StringWriter wtr = new StringWriter();
|
||||
int intChar;
|
||||
char nextChar;
|
||||
if (wrapWithEval) wtr.Write("eval(\"");
|
||||
while (true)
|
||||
{
|
||||
intChar = rdr.Read();
|
||||
if (intChar == -1) break;
|
||||
nextChar = Convert.ToChar(intChar);
|
||||
switch (nextChar)
|
||||
{
|
||||
case '\\':
|
||||
case '\'':
|
||||
case '"':
|
||||
wtr.Write('\\');
|
||||
wtr.Write(nextChar);
|
||||
break;
|
||||
case '\n':
|
||||
wtr.Write("\\n");
|
||||
break;
|
||||
case '\r':
|
||||
wtr.Write("\\r");
|
||||
break;
|
||||
case '\u2028':
|
||||
wtr.Write("\\u2028");
|
||||
break;
|
||||
case '\u2029':
|
||||
wtr.Write("\\u2029");
|
||||
break;
|
||||
default:
|
||||
wtr.Write(nextChar);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (wrapWithEval) wtr.Write("\")");
|
||||
return wtr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to read the templates which are used to generate a ES5 format files.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string GetTemplateFile(string configSetting)
|
||||
{
|
||||
string inputTemplatePath = ConfigurationManager.AppSettings[configSetting].ToString();
|
||||
return (new StreamReader(inputTemplatePath)).ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Initial Version covers the following features,
|
||||
1. Conversion of Sputnik tests that are in the basic/common format to ES5 formats
|
||||
2. Splitting multiple checks into individual files
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<formats>
|
||||
<format id="1" sequence="1">\s*CHECK#[0-9]\r\n(.*(\r\n)?.)+</format>
|
||||
</formats>
|
|
@ -1,93 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Microsoft.Sputnik.Interop.ParserEngine
|
||||
{
|
||||
public class Logger
|
||||
{
|
||||
private static string logFileDir = string.Empty;
|
||||
private StreamWriter writer;
|
||||
|
||||
private static Logger logger;
|
||||
|
||||
private Logger()
|
||||
{
|
||||
logFileDir = ConfigurationManager.AppSettings[ResourceClass.LogFileDirectorySettingKey].ToString();
|
||||
string filename = Path.Combine(logFileDir, string.Concat(DateTime.Now.ToString("MM-dd-yyyy"), ".log"));
|
||||
writer = File.CreateText(filename);
|
||||
}
|
||||
|
||||
private static Logger GetLoggerInstance()
|
||||
{
|
||||
if (logger == null)
|
||||
{
|
||||
logger = new Logger();
|
||||
}
|
||||
return logger;
|
||||
}
|
||||
|
||||
public static void WriteToLog(string logText)
|
||||
{
|
||||
Logger logger = GetLoggerInstance();
|
||||
logger.Write(logText);
|
||||
}
|
||||
|
||||
private void Write(string logText)
|
||||
{
|
||||
try
|
||||
{
|
||||
writer.WriteLine(logText);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void Write(string format, params string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
writer.WriteLine(format, args);
|
||||
}
|
||||
catch (FormatException ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to write execution progress information to the log file
|
||||
/// </summary>
|
||||
/// <param name="format">The format.</param>
|
||||
/// <param name="args">The args.</param>
|
||||
public static void WriteToLog(string format, params string[] args)
|
||||
{
|
||||
Logger logger = GetLoggerInstance();
|
||||
logger.Write(format, args);
|
||||
}
|
||||
|
||||
public static void Dispose()
|
||||
{
|
||||
Logger logger = GetLoggerInstance();
|
||||
logger.DisposeWriter();
|
||||
}
|
||||
|
||||
private void DisposeWriter()
|
||||
{
|
||||
if (writer != null)
|
||||
{
|
||||
writer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,142 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{ECFBE9D7-6DA9-47CA-B196-DF5A74BAACD6}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.Sputnik.Interop.ParserEngine</RootNamespace>
|
||||
<AssemblyName>Microsoft.Sputnik.Interop.ParserEngine</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Microsoft.Sputnik.Interop.ParserEngine.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ES5TestCase.cs" />
|
||||
<Compile Include="Logger.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ResourceClass.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>ResourceClass.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SputnikTestCase.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="InputFormats.xml">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="testNegativePrereqTemplate.js">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="testNegativeTemplate.js">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="testTemplate.js">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="testPrereqTemplate.js">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="ResourceClass.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>ResourceClass.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Conformance\" />
|
||||
<Folder Include="tests\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||
<InstallUrlHistory />
|
||||
<SupportUrlHistory />
|
||||
<UpdateUrlHistory />
|
||||
<BootstrapperUrlHistory />
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<StartWorkingDirectory>
|
||||
</StartWorkingDirectory>
|
||||
<StartArguments>G:\262\test262\test\suite\sputnik\conformance G:\262\test262\test\suite\sputnik_new01</StartArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Sputnik.Interop.ParserEngine", "Microsoft.Sputnik.Interop.ParserEngine.csproj", "{ECFBE9D7-6DA9-47CA-B196-DF5A74BAACD6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{ECFBE9D7-6DA9-47CA-B196-DF5A74BAACD6}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{ECFBE9D7-6DA9-47CA-B196-DF5A74BAACD6}.Debug|x86.Build.0 = Debug|x86
|
||||
{ECFBE9D7-6DA9-47CA-B196-DF5A74BAACD6}.Release|x86.ActiveCfg = Release|x86
|
||||
{ECFBE9D7-6DA9-47CA-B196-DF5A74BAACD6}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,60 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Microsoft.Sputnik.Interop.ParserEngine
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string source = string.Empty;
|
||||
string destination = string.Empty;
|
||||
|
||||
if (args == null || args.Length < 2)
|
||||
{
|
||||
System.Console.WriteLine("You must specify the source directory and the destination directory!");
|
||||
return;
|
||||
}
|
||||
source = args[0];
|
||||
destination = args[1];
|
||||
|
||||
string root = "conformance";
|
||||
|
||||
int countInputFiles = 0;
|
||||
try
|
||||
{
|
||||
Logger.WriteToLog("Start Time : {0}", DateTime.Now.ToString());
|
||||
if (Directory.Exists(source))
|
||||
{
|
||||
string[] filePaths = Directory.GetFiles(source, "*.js", SearchOption.AllDirectories);
|
||||
ES5TestScript.InitGlobals(destination);
|
||||
|
||||
foreach (string filePath in filePaths)
|
||||
{
|
||||
SputnikTestScript testScript = new SputnikTestScript();
|
||||
testScript.Load(filePath, root);
|
||||
ES5TestScript.Save(testScript, root, destination);
|
||||
countInputFiles++;
|
||||
}
|
||||
|
||||
ES5TestScript.UpdateGlobals(destination);
|
||||
}
|
||||
Logger.WriteToLog(ResourceClass.Total_Input_Files, countInputFiles.ToString());
|
||||
Logger.WriteToLog(ResourceClass.Total_Output_Files, ES5TestScript.OutputFileCounter.ToString());
|
||||
Console.WriteLine(ResourceClass.Total_Input_Files, countInputFiles.ToString());
|
||||
Console.WriteLine(ResourceClass.Total_Output_Files, ES5TestScript.OutputFileCounter.ToString());
|
||||
Console.WriteLine(ResourceClass.PressExit);
|
||||
Logger.WriteToLog("End Time : {0}", DateTime.Now.ToShortDateString());
|
||||
Console.ReadLine();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Logger.Dispose();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Microsoft.Sputnik.Interop.ParserEngine")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Microsoft.Sputnik.Interop.ParserEngine")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("af57bfc6-48f2-4587-980e-1a0f82b94d1e")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -1,288 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Sputnik.Interop.ParserEngine {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class ResourceClass {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal ResourceClass() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Sputnik.Interop.ParserEngine.ResourceClass", typeof(ResourceClass).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to BasicNegativePrereqInputTemplate.
|
||||
/// </summary>
|
||||
internal static string BasicNegativePrereqTemplate_FileName {
|
||||
get {
|
||||
return ResourceManager.GetString("BasicNegativePrereqTemplate_FileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to BasicNegativeInputTemplate.
|
||||
/// </summary>
|
||||
internal static string BasicNegativeTemplate_FileName {
|
||||
get {
|
||||
return ResourceManager.GetString("BasicNegativeTemplate_FileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to BasicPrereqInputTemplate.
|
||||
/// </summary>
|
||||
internal static string BasicPrereqTemplate_FileName {
|
||||
get {
|
||||
return ResourceManager.GetString("BasicPrereqTemplate_FileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to BasicInputTemplate.
|
||||
/// </summary>
|
||||
internal static string BasicTemplate_FileName {
|
||||
get {
|
||||
return ResourceManager.GetString("BasicTemplate_FileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to ChecksRegex.
|
||||
/// </summary>
|
||||
internal static string ChecksRegexSettingKey {
|
||||
get {
|
||||
return ResourceManager.GetString("ChecksRegexSettingKey", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to CommentsRegex.
|
||||
/// </summary>
|
||||
internal static string CommentsRegexSettingKey {
|
||||
get {
|
||||
return ResourceManager.GetString("CommentsRegexSettingKey", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File has been converted and saved at: {0}.
|
||||
/// </summary>
|
||||
internal static string FileConverted_Log {
|
||||
get {
|
||||
return ResourceManager.GetString("FileConverted_Log", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to GlobalCodeRegex.
|
||||
/// </summary>
|
||||
internal static string GlobalCodeRegexKey {
|
||||
get {
|
||||
return ResourceManager.GetString("GlobalCodeRegexKey", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to InputXMLPath.
|
||||
/// </summary>
|
||||
internal static string InputXMLPath {
|
||||
get {
|
||||
return ResourceManager.GetString("InputXMLPath", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed with exception, Message : {0}.
|
||||
/// </summary>
|
||||
internal static string IOException {
|
||||
get {
|
||||
return ResourceManager.GetString("IOException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to LogFileDirectory.
|
||||
/// </summary>
|
||||
internal static string LogFileDirectorySettingKey {
|
||||
get {
|
||||
return ResourceManager.GetString("LogFileDirectorySettingKey", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to assertion.
|
||||
/// </summary>
|
||||
internal static string LookFor_Assertion {
|
||||
get {
|
||||
return ResourceManager.GetString("LookFor_Assertion", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to description.
|
||||
/// </summary>
|
||||
internal static string LookFor_Description {
|
||||
get {
|
||||
return ResourceManager.GetString("LookFor_Description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to name.
|
||||
/// </summary>
|
||||
internal static string LookFor_Name {
|
||||
get {
|
||||
return ResourceManager.GetString("LookFor_Name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to negative.
|
||||
/// </summary>
|
||||
internal static string LookFor_Negative {
|
||||
get {
|
||||
return ResourceManager.GetString("LookFor_Negative", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to strict_mode_negative.
|
||||
/// </summary>
|
||||
internal static string LookFor_NegativeStrictMode {
|
||||
get {
|
||||
return ResourceManager.GetString("LookFor_NegativeStrictMode", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to section.
|
||||
/// </summary>
|
||||
internal static string LookFor_Section {
|
||||
get {
|
||||
return ResourceManager.GetString("LookFor_Section", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Matching regex is found for the file: {0}.
|
||||
/// </summary>
|
||||
internal static string Match_RegEx_Found {
|
||||
get {
|
||||
return ResourceManager.GetString("Match_RegEx_Found", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Could not find any matching regex format for the file: {0}.
|
||||
/// </summary>
|
||||
internal static string NoMatch_RegEex {
|
||||
get {
|
||||
return ResourceManager.GetString("NoMatch_RegEex", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Press enter key to exit....
|
||||
/// </summary>
|
||||
internal static string PressExit {
|
||||
get {
|
||||
return ResourceManager.GetString("PressExit", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Regular expression used for the file: {0} is {1} and its seqence Id is {2}.
|
||||
/// </summary>
|
||||
internal static string RegEx_Used {
|
||||
get {
|
||||
return ResourceManager.GetString("RegEx_Used", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Total number of sputnik test case files before conversion: {0}.
|
||||
/// </summary>
|
||||
internal static string Total_Input_Files {
|
||||
get {
|
||||
return ResourceManager.GetString("Total_Input_Files", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Total number of test cases which actually got converted: {0}.
|
||||
/// </summary>
|
||||
internal static string Total_Output_Files {
|
||||
get {
|
||||
return ResourceManager.GetString("Total_Output_Files", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unexpected error occured while converting files:.
|
||||
/// </summary>
|
||||
internal static string Unexpected_Error {
|
||||
get {
|
||||
return ResourceManager.GetString("Unexpected_Error", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error occured while reading regex formats from InputFormats.xml files: {0}.
|
||||
/// </summary>
|
||||
internal static string XMLException_Log {
|
||||
get {
|
||||
return ResourceManager.GetString("XMLException_Log", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,195 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ChecksRegexSettingKey" xml:space="preserve">
|
||||
<value>ChecksRegex</value>
|
||||
</data>
|
||||
<data name="CommentsRegexSettingKey" xml:space="preserve">
|
||||
<value>CommentsRegex</value>
|
||||
</data>
|
||||
<data name="FileConverted_Log" xml:space="preserve">
|
||||
<value>File has been converted and saved at: {0}</value>
|
||||
</data>
|
||||
<data name="GlobalCodeRegexKey" xml:space="preserve">
|
||||
<value>GlobalCodeRegex</value>
|
||||
</data>
|
||||
<data name="InputXMLPath" xml:space="preserve">
|
||||
<value>InputXMLPath</value>
|
||||
</data>
|
||||
<data name="IOException" xml:space="preserve">
|
||||
<value>Failed with exception, Message : {0}</value>
|
||||
</data>
|
||||
<data name="LogFileDirectorySettingKey" xml:space="preserve">
|
||||
<value>LogFileDirectory</value>
|
||||
</data>
|
||||
<data name="LookFor_Description" xml:space="preserve">
|
||||
<value>description</value>
|
||||
</data>
|
||||
<data name="LookFor_Name" xml:space="preserve">
|
||||
<value>name</value>
|
||||
</data>
|
||||
<data name="LookFor_Section" xml:space="preserve">
|
||||
<value>section</value>
|
||||
</data>
|
||||
<data name="Match_RegEx_Found" xml:space="preserve">
|
||||
<value>Matching regex is found for the file: {0}</value>
|
||||
</data>
|
||||
<data name="NoMatch_RegEex" xml:space="preserve">
|
||||
<value>Could not find any matching regex format for the file: {0}</value>
|
||||
</data>
|
||||
<data name="PressExit" xml:space="preserve">
|
||||
<value>Press enter key to exit...</value>
|
||||
</data>
|
||||
<data name="RegEx_Used" xml:space="preserve">
|
||||
<value>Regular expression used for the file: {0} is {1} and its seqence Id is {2}</value>
|
||||
</data>
|
||||
<data name="BasicTemplate_FileName" xml:space="preserve">
|
||||
<value>BasicInputTemplate</value>
|
||||
</data>
|
||||
<data name="Total_Input_Files" xml:space="preserve">
|
||||
<value>Total number of sputnik test case files before conversion: {0}</value>
|
||||
</data>
|
||||
<data name="Total_Output_Files" xml:space="preserve">
|
||||
<value>Total number of test cases which actually got converted: {0}</value>
|
||||
</data>
|
||||
<data name="Unexpected_Error" xml:space="preserve">
|
||||
<value>Unexpected error occured while converting files:</value>
|
||||
</data>
|
||||
<data name="XMLException_Log" xml:space="preserve">
|
||||
<value>Error occured while reading regex formats from InputFormats.xml files: {0}</value>
|
||||
</data>
|
||||
<data name="BasicNegativePrereqTemplate_FileName" xml:space="preserve">
|
||||
<value>BasicNegativePrereqInputTemplate</value>
|
||||
</data>
|
||||
<data name="BasicNegativeTemplate_FileName" xml:space="preserve">
|
||||
<value>BasicNegativeInputTemplate</value>
|
||||
</data>
|
||||
<data name="BasicPrereqTemplate_FileName" xml:space="preserve">
|
||||
<value>BasicPrereqInputTemplate</value>
|
||||
</data>
|
||||
<data name="LookFor_Negative" xml:space="preserve">
|
||||
<value>negative</value>
|
||||
</data>
|
||||
<data name="LookFor_NegativeStrictMode" xml:space="preserve">
|
||||
<value>strict_mode_negative</value>
|
||||
</data>
|
||||
<data name="LookFor_Assertion" xml:space="preserve">
|
||||
<value>assertion</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1,327 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using System.Configuration;
|
||||
using System.Xml.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Microsoft.Sputnik.Interop.ParserEngine
|
||||
{
|
||||
[DataContract]
|
||||
public class SputnikTestScript
|
||||
{
|
||||
private string testScriptID = string.Empty;
|
||||
private string testScriptSection = string.Empty;
|
||||
private string testScriptDescription = string.Empty;
|
||||
private string testScriptAssertion = string.Empty;
|
||||
private string replicationCode = string.Empty;
|
||||
private int actualFileConvertedCount = 0;
|
||||
public bool negativeTest = false;
|
||||
private bool strictModeNegativeTest = false;
|
||||
private const string xmlNode = "format";
|
||||
private const string xmlAttribute = "sequence";
|
||||
private string[] checkSections;
|
||||
private SortedDictionary<string, string> testScriptFormats = new SortedDictionary<string, string>();
|
||||
|
||||
public string Header = string.Empty;
|
||||
public string Body = string.Empty;
|
||||
public string InitialComment = string.Empty;
|
||||
public string pathFromRoot = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ID.
|
||||
/// </summary>
|
||||
/// <value>The ID.</value>
|
||||
[DataMember]
|
||||
public string id
|
||||
{
|
||||
get
|
||||
{
|
||||
return testScriptID;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
testScriptID = value.Trim();
|
||||
}
|
||||
}
|
||||
public bool IsNegativeInStrictMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return strictModeNegativeTest;
|
||||
}
|
||||
set
|
||||
{
|
||||
strictModeNegativeTest = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the netative test flag.
|
||||
/// </summary>
|
||||
/// <value>true if this is a @negative test</value>
|
||||
public bool IsNegative
|
||||
{
|
||||
get
|
||||
{
|
||||
return negativeTest;
|
||||
}
|
||||
set
|
||||
{
|
||||
negativeTest=value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the testScriptSection
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string path
|
||||
{
|
||||
get
|
||||
{
|
||||
return testScriptSection;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(value!=null)
|
||||
testScriptSection = value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Actual number of input files which got converted
|
||||
/// </summary>
|
||||
public int ConvertedFileCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return actualFileConvertedCount;
|
||||
}
|
||||
set
|
||||
{
|
||||
actualFileConvertedCount = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the testScriptDescription
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string description
|
||||
{
|
||||
get
|
||||
{
|
||||
return testScriptDescription;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
testScriptDescription = value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the testScriptAssersion
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public string assertion
|
||||
{
|
||||
get
|
||||
{
|
||||
return testScriptAssertion;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
testScriptAssertion = value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value for checkSections
|
||||
/// </summary>
|
||||
public string[] Checks
|
||||
{
|
||||
get
|
||||
{
|
||||
return checkSections;
|
||||
}
|
||||
set
|
||||
{
|
||||
checkSections = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the full path.
|
||||
/// </summary>
|
||||
/// <value>The full path.</value>
|
||||
public string FullPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the replication code.
|
||||
/// </summary>
|
||||
/// <value>The replication code.</value>
|
||||
public string ReplicationCode
|
||||
{
|
||||
get
|
||||
{
|
||||
return replicationCode;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
replicationCode = value.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the possible checks count.
|
||||
/// </summary>
|
||||
/// <value>The possible checks count.</value>
|
||||
public int PossibleChecksCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the pre condition code.
|
||||
/// </summary>
|
||||
/// <value>The pre condition code.</value>
|
||||
public string PreConditionCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor which reads the regular expression formats from InputFormats.xml file
|
||||
/// </summary>
|
||||
public SputnikTestScript()
|
||||
{
|
||||
ReadInputXml();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reads the regular expression formats from inputformats.xml file
|
||||
/// </summary>
|
||||
public void ReadInputXml()
|
||||
{
|
||||
string inputXmlPath = Path.GetFullPath(ConfigurationManager.AppSettings[ResourceClass.InputXMLPath].ToString());
|
||||
XmlTextReader reader = new XmlTextReader(inputXmlPath);
|
||||
try
|
||||
{
|
||||
if (File.Exists(inputXmlPath))
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
switch (reader.NodeType)
|
||||
{
|
||||
case XmlNodeType.Element:
|
||||
if (!Convert.ToBoolean(string.Compare(reader.Name.ToLower(), xmlNode)))
|
||||
{
|
||||
testScriptFormats.Add(reader.GetAttribute(xmlAttribute), reader.ReadString());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (XmlException ex)
|
||||
{
|
||||
Logger.WriteToLog(string.Format(ResourceClass.XMLException_Log, ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the sputnik testscript file and extracts the required details from it
|
||||
/// </summary>
|
||||
/// <param name="filePath">Path to the source file</param>
|
||||
public void Load(string filePath, string root)
|
||||
{
|
||||
string[] regexTrimDelimiter = { "\n","\r"};
|
||||
String fullFile = string.Empty;
|
||||
|
||||
using (TextReader txtReader = new StreamReader(filePath))
|
||||
{
|
||||
fullFile = txtReader.ReadToEnd();
|
||||
}
|
||||
this.FullPath = filePath;
|
||||
int indexOfRoot = this.FullPath.IndexOf(root, StringComparison.InvariantCulture) + root.Length + 1;
|
||||
this.pathFromRoot = this.FullPath.Substring(indexOfRoot, this.FullPath.Length - indexOfRoot);
|
||||
|
||||
Regex regx = new Regex("\\\\S([0-9]+)_([^\\\\]+)\\.js$");
|
||||
if (regx.IsMatch(this.pathFromRoot))
|
||||
{
|
||||
Match tempMatch = regx.Match(this.pathFromRoot);
|
||||
String tempDir = "\\" + tempMatch.Groups[1].Value + ".0_Chapter";
|
||||
this.pathFromRoot = regx.Replace(this.pathFromRoot, tempDir + "\\S$1.0_$2.js");
|
||||
}
|
||||
ReadSimpleTestCase(fullFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a basic sputnik test file and create an object for it. Assume just a header comment and a test body
|
||||
/// </summary>
|
||||
/// <param name="fullFile">Input file content</param>
|
||||
private void ReadSimpleTestCase(string fullFile)
|
||||
{
|
||||
char[] delimiter = { ':' };
|
||||
char[] trimDelimit = { ';' ,'\r','\n'};
|
||||
string holdStr = string.Empty;
|
||||
string[] arrComments;
|
||||
|
||||
Regex commentTailRegex = new Regex("\\s*\\*\\/\\s*");
|
||||
Match matchCommentTail = commentTailRegex.Match(fullFile);
|
||||
|
||||
this.Header = fullFile.Substring(0,matchCommentTail.Index+matchCommentTail.Length);
|
||||
|
||||
Regex csharpCommentRegx = new Regex("\\/\\*");
|
||||
Match matchCSharpCommentHead = csharpCommentRegx.Match(this.Header);
|
||||
this.InitialComment = this.Header.Substring(0, matchCSharpCommentHead.Index);
|
||||
|
||||
this.Body = fullFile.Substring(matchCommentTail.Index+matchCommentTail.Length);
|
||||
|
||||
string commentFormat = "@[a-zA-Z0-9_]+(:\\s*[^\\r\\n]*)?;?\\s*(\\r|\\n)";
|
||||
Regex regx = new Regex(commentFormat);
|
||||
MatchCollection matchComments = regx.Matches(this.Header);
|
||||
|
||||
foreach (Match comment in matchComments)
|
||||
{
|
||||
holdStr = comment.Value;
|
||||
arrComments = holdStr.Trim(trimDelimit).Trim().Split(delimiter,2);
|
||||
|
||||
string commentKey = arrComments[0].ToLower();
|
||||
if (commentKey.Contains(ResourceClass.LookFor_Name))
|
||||
{
|
||||
this.id = this.pathFromRoot.Substring(this.pathFromRoot.LastIndexOf("\\") + 1);
|
||||
this.id = this.id.Remove(this.id.Length - 3);
|
||||
}
|
||||
if (commentKey.Contains(ResourceClass.LookFor_Section))
|
||||
{
|
||||
this.path = this.pathFromRoot;
|
||||
}
|
||||
if (commentKey.Contains(ResourceClass.LookFor_Assertion))
|
||||
{
|
||||
this.assertion = arrComments[arrComments.Length - 1].Trim(trimDelimit);
|
||||
}
|
||||
if (commentKey.Contains(ResourceClass.LookFor_Description))
|
||||
{
|
||||
this.description = arrComments[arrComments.Length - 1].Trim(trimDelimit);
|
||||
}
|
||||
if (commentKey.Contains(ResourceClass.LookFor_NegativeStrictMode))
|
||||
{
|
||||
this.IsNegativeInStrictMode = true;
|
||||
}
|
||||
if (commentKey.Contains(ResourceClass.LookFor_Negative))
|
||||
{
|
||||
if (!arrComments[0].Contains(ResourceClass.LookFor_NegativeStrictMode)) this.IsNegative = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.PossibleChecksCount = 1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<formats>
|
||||
<format id="1" sequence="1">\s*CHECK#[0-9]\r\n(.*(\r\n)?.)+</format>
|
||||
</formats>
|
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="LogFileDirectory" value="."/>
|
||||
<add key="InputXMLPath" value=".\InputFormats.xml"/>
|
||||
<add key="BasicInputTemplate" value=".\testTemplate.js"/>
|
||||
<add key="BasicPrereqInputTemplate" value=".\testPrereqTemplate.js"/>
|
||||
<add key="BasicNegativeInputTemplate" value=".\testNegativeTemplate.js"/>
|
||||
<add key="BasicNegativePrereqInputTemplate" value=".\testNegativePrereqTemplate.js"/>
|
||||
<add key="CommentsRegex" value="^@[a-zA-Z0-9]*(:\s*.*;{1})?$"/>
|
||||
<add key="ChecksRegex" value=".\s*CHECK#[0-9].\s*"/>
|
||||
<add key="GlobalCodeRegex" value="\*/[\r\n]*.*"/>
|
||||
</appSettings>
|
||||
</configuration>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="LogFileDirectory" value="."/>
|
||||
<add key="InputXMLPath" value=".\InputFormats.xml"/>
|
||||
<add key="BasicInputTemplate" value=".\testTemplate.js"/>
|
||||
<add key="BasicPrereqInputTemplate" value=".\testPrereqTemplate.js"/>
|
||||
<add key="BasicNegativeInputTemplate" value=".\testNegativeTemplate.js"/>
|
||||
<add key="BasicNegativePrereqInputTemplate" value=".\testNegativePrereqTemplate.js"/>
|
||||
<add key="CommentsRegex" value="^@[a-zA-Z0-9]*(:\s*.*;{1})?$"/>
|
||||
<add key="ChecksRegex" value=".\s*CHECK#[0-9].\s*"/>
|
||||
<add key="GlobalCodeRegex" value="\*/[\r\n]*.*"/>
|
||||
</appSettings>
|
||||
</configuration>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
|
@ -1,22 +0,0 @@
|
|||
{0}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {{
|
||||
id: "{1}",
|
||||
|
||||
path: "TestCases/{2}",
|
||||
|
||||
description: "{4}",
|
||||
|
||||
test: function testcase() {{
|
||||
try {{
|
||||
(function() {{
|
||||
{5} {6} }})();
|
||||
}} catch (__e__) {{return true /* failure is success */}};
|
||||
return false /* but success is failure */
|
||||
}},
|
||||
|
||||
precondition: function precond() {{
|
||||
{7}
|
||||
}}
|
||||
}});
|
|
@ -1,4 +0,0 @@
|
|||
{8}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
{5} {6}
|
|
@ -1,21 +0,0 @@
|
|||
{0}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {{
|
||||
id: "{1}",
|
||||
|
||||
path: "TestCases/{2}",
|
||||
|
||||
assertion: "{3}",
|
||||
|
||||
description: "{4}",
|
||||
|
||||
test: function testcase() {{
|
||||
{5} {6}
|
||||
}},
|
||||
|
||||
precondition: function precond() {{
|
||||
{7}
|
||||
}}
|
||||
|
||||
}});
|
|
@ -1,16 +0,0 @@
|
|||
{0}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {{
|
||||
id: "{1}",
|
||||
|
||||
path: "TestCases/{2}",
|
||||
|
||||
assertion: "{3}",
|
||||
|
||||
description: "{4}",
|
||||
|
||||
test: function testcase() {{
|
||||
{5} {6}
|
||||
}}
|
||||
}});
|
|
@ -1,22 +0,0 @@
|
|||
{0}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {{
|
||||
id: "{1}",
|
||||
|
||||
path: "TestCases/{2}",
|
||||
|
||||
description: "{4}",
|
||||
|
||||
test: function testcase() {{
|
||||
try {{
|
||||
(function() {{
|
||||
{5} {6} }})();
|
||||
}} catch (__e__) {{return true /* failure is success */}};
|
||||
return false /* but success is failure */
|
||||
}},
|
||||
|
||||
precondition: function precond() {{
|
||||
{7}
|
||||
}}
|
||||
}});
|
|
@ -1,4 +0,0 @@
|
|||
{8}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
{5} {6}
|
|
@ -1,21 +0,0 @@
|
|||
{0}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {{
|
||||
id: "{1}",
|
||||
|
||||
path: "TestCases/{2}",
|
||||
|
||||
assertion: "{3}",
|
||||
|
||||
description: "{4}",
|
||||
|
||||
test: function testcase() {{
|
||||
{5} {6}
|
||||
}},
|
||||
|
||||
precondition: function precond() {{
|
||||
{7}
|
||||
}}
|
||||
|
||||
}});
|
|
@ -1,16 +0,0 @@
|
|||
{0}
|
||||
// Converted for Test262 from original Sputnik source
|
||||
|
||||
ES5Harness.registerTest( {{
|
||||
id: "{1}",
|
||||
|
||||
path: "TestCases/{2}",
|
||||
|
||||
assertion: "{3}",
|
||||
|
||||
description: "{4}",
|
||||
|
||||
test: function testcase() {{
|
||||
{5} {6}
|
||||
}}
|
||||
}});
|
|
@ -1,308 +0,0 @@
|
|||
# Copyright (c) 2009 Microsoft Corporation
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
# that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
# the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
# the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
# endorse or promote products derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#--Imports---------------------------------------------------------------------
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import xml.dom.minidom
|
||||
import base64
|
||||
import datetime
|
||||
import shutil
|
||||
import re
|
||||
import json
|
||||
import stat
|
||||
|
||||
#--Stubs-----------------------------------------------------------------------
|
||||
def generateHarness(harnessType, jsonFile, description):
|
||||
pass
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
from TestCasePackagerConfig import *
|
||||
|
||||
#--Globals---------------------------------------------------------------------
|
||||
|
||||
__parser = argparse.ArgumentParser(description='Tool used to generate the test262 website')
|
||||
__parser.add_argument('version', action='store',
|
||||
help='Version of the test suite.')
|
||||
__parser.add_argument('--type', action='store', default='test262',
|
||||
help='Type of test case runner to generate.')
|
||||
ARGS = __parser.parse_args()
|
||||
|
||||
if not os.path.exists(EXCLUDED_FILENAME):
|
||||
print "Cannot generate (JSON) test262 tests without a file, %s, showing which tests have been disabled!" % EXCLUDED_FILENAME
|
||||
sys.exit(1)
|
||||
EXCLUDE_LIST = xml.dom.minidom.parse(EXCLUDED_FILENAME)
|
||||
EXCLUDE_LIST = EXCLUDE_LIST.getElementsByTagName("test")
|
||||
EXCLUDE_LIST = [x.getAttribute("id") for x in EXCLUDE_LIST]
|
||||
|
||||
#a list of all ES5 test chapter directories
|
||||
TEST_SUITE_SECTIONS = []
|
||||
|
||||
#total number of tests accross the entire set of tests.
|
||||
TOTAL_TEST_COUNT = 0
|
||||
|
||||
#global which states whether the test case we're currently processing is in
|
||||
#the midst of a "/* ... */" style comment
|
||||
IS_MULTILINE_COMMENT = False
|
||||
|
||||
#List of all *.json files containing encoded test cases
|
||||
SECTIONS_LIST = []
|
||||
|
||||
ONE_JSON_PER_CHAPTER = False
|
||||
TESTCASELIST_PER_JSON = False
|
||||
|
||||
#--Sanity checks--------------------------------------------------------------#
|
||||
if not os.path.exists(TEST262_CASES_DIR):
|
||||
print "Cannot generate (JSON) test262 tests when the path containing said tests, %s, does not exist!" % TEST262_CASES_DIR
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.exists(TEST262_HARNESS_DIR):
|
||||
print "Cannot copy the test harness from a path, %s, that does not exist!" % TEST262_HARNESS_DIR
|
||||
sys.exit(1)
|
||||
|
||||
if not os.path.exists(TEST262_WEB_CASES_DIR):
|
||||
os.mkdir(TEST262_WEB_CASES_DIR)
|
||||
|
||||
if not os.path.exists(TEST262_WEB_HARNESS_DIR):
|
||||
os.mkdir(TEST262_WEB_HARNESS_DIR)
|
||||
|
||||
if not hasattr(ARGS, "version"):
|
||||
print "A test262 suite version must be specified from the command-line to run this script!"
|
||||
sys.exit(1)
|
||||
|
||||
#--Helpers--------------------------------------------------------------------#
|
||||
def getJSCount(dirName):
|
||||
'''
|
||||
Returns the total number of *.js files (recursively) under a given
|
||||
directory, dirName.
|
||||
'''
|
||||
retVal = 0
|
||||
if os.path.isfile(dirName) and dirName.endswith(".js"):
|
||||
retVal = 1
|
||||
elif os.path.isdir(dirName):
|
||||
tempList = [os.path.join(dirName, x) for x in os.listdir(dirName)]
|
||||
for x in tempList:
|
||||
retVal += getJSCount(x)
|
||||
#else:
|
||||
# raise Exception("getJSCount: encountered a non-file/non-dir!")
|
||||
return retVal
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
def dirWalker(dirName):
|
||||
'''
|
||||
Populates TEST_SUITE_SECTIONS with ES5 test directories based
|
||||
upon the number of test files per directory.
|
||||
'''
|
||||
global TEST_SUITE_SECTIONS
|
||||
#First check to see if it has test files directly inside it
|
||||
temp = [os.path.join(dirName, x) for x in os.listdir(dirName) if not os.path.isdir(os.path.join(dirName, x))]
|
||||
if len(temp)!=0:
|
||||
TEST_SUITE_SECTIONS.append(dirName)
|
||||
return
|
||||
|
||||
#Next check to see if all *.js files under this directory exceed our max
|
||||
#for a JSON file
|
||||
temp = getJSCount(dirName)
|
||||
if temp==0:
|
||||
print "ERROR: expected there to be JavaScript tests under dirName!"
|
||||
sys.exit(1)
|
||||
elif temp < MAX_CASES_PER_JSON:
|
||||
TEST_SUITE_SECTIONS.append(dirName)
|
||||
return
|
||||
else:
|
||||
#Max has been exceeded. We need to look at each subdir individually
|
||||
temp = os.listdir(dirName)
|
||||
for tempSubdir in temp:
|
||||
dirWalker(os.path.join(dirName, tempSubdir))
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
def isTestStarted(line):
|
||||
'''
|
||||
Used to detect if we've gone past extraneous test comments in a test case.
|
||||
|
||||
Note this is a naive approach on the sense that "/*abc*/" could be on one
|
||||
line. However, we know for a fact this is not the case in IE Test Center
|
||||
or Sputnik tests.
|
||||
'''
|
||||
global IS_MULTILINE_COMMENT
|
||||
|
||||
if IS_MULTILINE_COMMENT and ("*/" in line): #End of a newline comment
|
||||
IS_MULTILINE_COMMENT = False
|
||||
return False
|
||||
elif "/*" in line: #Beginning of a newline comment
|
||||
IS_MULTILINE_COMMENT = True
|
||||
return False
|
||||
elif IS_MULTILINE_COMMENT: #//we're already in a multi-line comment that hasn't ended
|
||||
return False
|
||||
elif re.match("^\s*//", line)!=None: #//blah
|
||||
return False
|
||||
elif re.match("^\s*$", line)!=None: #newlines
|
||||
return False
|
||||
elif "ES5Harness" in line: #definitely start of the test!
|
||||
return True
|
||||
return True
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
def getAllJSFiles(dirName):
|
||||
retVal = []
|
||||
for fullPath,dontCare,files in os.walk(dirName):
|
||||
retVal += [os.path.join(fullPath,b) for b in files if b.endswith(".js")]
|
||||
return retVal
|
||||
|
||||
#--MAIN------------------------------------------------------------------------
|
||||
for temp in TEST_CONTRIB_DIRS:
|
||||
temp = os.path.join(TEST262_CASES_DIR, temp)
|
||||
if not os.path.exists(temp):
|
||||
print "The expected ES5 test directory,", temp, "did not exist!"
|
||||
sys.exit(1)
|
||||
|
||||
if not ONE_JSON_PER_CHAPTER:
|
||||
dirWalker(temp)
|
||||
else:
|
||||
for tempSubdir in os.listdir(temp):
|
||||
TEST_SUITE_SECTIONS.append(os.path.join(temp, tempSubdir))
|
||||
|
||||
|
||||
for chapter in TEST_SUITE_SECTIONS:
|
||||
chapterName = chapter.rsplit(os.path.sep, 1)[1]
|
||||
print "Generating test cases for ES5 chapter:", chapterName
|
||||
#create dictionaries for all our tests and a section
|
||||
testsList = {}
|
||||
sect = {}
|
||||
sect["name"] = "Chapter - " + chapterName
|
||||
|
||||
#create an array for tests in a chapter
|
||||
tests = []
|
||||
sourceFiles = getAllJSFiles(chapter)
|
||||
|
||||
if len(sourceFiles)!=0:
|
||||
excluded = 0
|
||||
testCount = 0
|
||||
for test in sourceFiles:
|
||||
#TODO - use something other than the hard-coded 'TestCases' below
|
||||
testPath = "TestCases" + test.split(TEST262_CASES_DIR, 1)[1].replace("\\", "/")
|
||||
testName=test.rsplit(".", 1)[0]
|
||||
testName=testName.rsplit(os.path.sep, 1)[1]
|
||||
if EXCLUDE_LIST.count(testName)==0:
|
||||
# dictionary for each test
|
||||
testDict = {}
|
||||
testDict["id"] = testName
|
||||
testDict["path"] = testPath.replace("/ietestcenter", "").replace("/sputnik_converted", "")
|
||||
|
||||
tempFile = open(test, "r")
|
||||
scriptCode = tempFile.readlines()
|
||||
tempFile.close()
|
||||
scriptCodeContent=""
|
||||
#Rip out license headers that add unnecessary bytes to the JSON'ized test cases
|
||||
inBeginning = True
|
||||
IS_MULTILINE_COMMENT = False
|
||||
|
||||
for line in scriptCode:
|
||||
if inBeginning:
|
||||
isStarted = isTestStarted(line)
|
||||
if not isStarted:
|
||||
continue
|
||||
inBeginning = False
|
||||
scriptCodeContent += line
|
||||
|
||||
if scriptCodeContent=="":
|
||||
print "WARNING (" + test + "): unable to strip comments/license header/etc."
|
||||
scriptCodeContent = "".join(scriptCode)
|
||||
scriptCodeContent = base64.b64encode(scriptCodeContent)
|
||||
|
||||
#add the test encoded code node to our test dictionary
|
||||
testDict["code"] = scriptCodeContent
|
||||
#now close the dictionary for the test
|
||||
|
||||
#this adds the test to our tests array
|
||||
tests.append(testDict)
|
||||
testCount += 1
|
||||
else:
|
||||
print "Excluded:", testName
|
||||
excluded = excluded + 1
|
||||
|
||||
#we have completed our tests
|
||||
# add section node, number of tests and the tests themselves.
|
||||
sect["numTests"] = str(len(sourceFiles)-excluded)
|
||||
sect["tests"] = tests
|
||||
|
||||
#create a node for the tests and add it to our testsLists
|
||||
testsList["testsCollection"] = sect
|
||||
with open(os.path.join(TEST262_WEB_CASES_DIR, chapterName + ".json"), "w") as f:
|
||||
json.dump(testsList, f, separators=(',',':'), sort_keys=True)
|
||||
|
||||
|
||||
if TESTCASELIST_PER_JSON:
|
||||
CHAPTER_TEST_CASES_JSON = {}
|
||||
CHAPTER_TEST_CASES_JSON["numTests"] = int(sect["numTests"])
|
||||
CHAPTER_TEST_CASES_JSON["version"] = ARGS.version
|
||||
CHAPTER_TEST_CASES_JSON["date"] = str(datetime.datetime.now().date())
|
||||
CHAPTER_TEST_CASES_JSON["testSuite"] = [WEBSITE_CASES_PATH + chapterName + ".json"]
|
||||
with open(os.path.join(TEST262_WEB_CASES_DIR, "testcases_%s.json" % chapterName), "w") as f:
|
||||
json.dump(CHAPTER_TEST_CASES_JSON, f, separators=(',',':'), sort_keys=True)
|
||||
generateHarness(ARGS.type, "testcases_%s.json" % chapterName, chapterName.replace("chapter", "Chapter "))
|
||||
|
||||
#add the name of the chapter test to our complete list
|
||||
SECTIONS_LIST.append(WEBSITE_CASES_PATH + chapterName + ".json")
|
||||
TOTAL_TEST_COUNT += int(sect["numTests"])
|
||||
|
||||
|
||||
#we now have the list of files for each chapter
|
||||
#create a root node for our suite
|
||||
TEST_CASES_JSON = {}
|
||||
TEST_CASES_JSON["numTests"] = TOTAL_TEST_COUNT
|
||||
TEST_CASES_JSON["version"] = ARGS.version
|
||||
TEST_CASES_JSON["date"] = str(datetime.datetime.now().date())
|
||||
TEST_CASES_JSON["testSuite"] = SECTIONS_LIST
|
||||
with open(os.path.join(TEST262_WEB_CASES_DIR, "default.json"), "w") as f:
|
||||
json.dump(TEST_CASES_JSON, f, separators=(',',':'), sort_keys=True)
|
||||
generateHarness(ARGS.type, "default.json", "Chapters 1-16")
|
||||
|
||||
#Deploy test harness to website as well
|
||||
print ""
|
||||
print "Deploying test harness files to 'TEST262_WEB_HARNESS_DIR'..."
|
||||
if TEST262_HARNESS_DIR!=TEST262_WEB_HARNESS_DIR:
|
||||
for filename in [x for x in os.listdir(TEST262_HARNESS_DIR) if x.endswith(".js")]:
|
||||
toFilename = os.path.join(TEST262_WEB_HARNESS_DIR, filename)
|
||||
fileExists = os.path.exists(toFilename)
|
||||
if fileExists:
|
||||
SC_HELPER.edit(toFilename)
|
||||
shutil.copy(os.path.join(TEST262_HARNESS_DIR, filename),
|
||||
toFilename)
|
||||
if not fileExists:
|
||||
SC_HELPER.add(toFilename)
|
||||
|
||||
#Copying the global scope files over as well
|
||||
#TODO: really the HTML harness file should be generated as well...
|
||||
print ""
|
||||
print "Deploying global scope metadata files to 'TEST262_WEB_HARNESS_DIR'..."
|
||||
for gsf in GLOBAL_SCOPE_FILES:
|
||||
toFilename = os.path.join(TEST262_WEB_CASES_DIR, gsf)
|
||||
fileExists = os.path.exists(toFilename)
|
||||
if fileExists:
|
||||
SC_HELPER.edit(toFilename)
|
||||
shutil.copy(os.path.join(TEST262_CASES_DIR, gsf),
|
||||
toFilename)
|
||||
if not fileExists:
|
||||
SC_HELPER.add(toFilename)
|
||||
|
||||
print "Done."
|
|
@ -1,110 +0,0 @@
|
|||
# Copyright (c) 2009 Microsoft Corporation
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are permitted provided
|
||||
# that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright notice, this list of conditions and
|
||||
# the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
|
||||
# the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of Microsoft nor the names of its contributors may be used to
|
||||
# endorse or promote products derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#--Imports---------------------------------------------------------------------
|
||||
import os
|
||||
import subprocess
|
||||
import stat
|
||||
|
||||
#--Globals---------------------------------------------------------------------
|
||||
MAX_CASES_PER_JSON = 1000
|
||||
|
||||
#Directories under "test\suite\" containing ES5 test chapter directories
|
||||
#with *.js tests underneath them
|
||||
TEST_CONTRIB_DIRS = ["sputnik_converted", "ietestcenter"]
|
||||
|
||||
#Global scope source files found directly under "test\suite\".
|
||||
GLOBAL_SCOPE_FILES = ["SputnikGlobalScope.js", "IETCGlobalScope.js"]
|
||||
|
||||
#Path to the root of the Hg repository (relative to this file's location)
|
||||
TEST262_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")
|
||||
TEST262_ROOT = os.path.abspath(TEST262_ROOT)
|
||||
|
||||
#Directory full of test cases we want to port to the website's test harness runner
|
||||
TEST262_CASES_DIR = os.path.join(TEST262_ROOT, "test", "suite")
|
||||
|
||||
#Directory containing test harness files to be ported over to the website. Note that
|
||||
#only *.js files will be migrated from this dir.
|
||||
TEST262_HARNESS_DIR = os.path.join(TEST262_ROOT, "test", "harness")
|
||||
|
||||
#Directory full of website test cases (ported over from TEST262_CASES_DIR)
|
||||
TEST262_WEB_CASES_DIR = os.path.join(TEST262_ROOT, "website", "resources", "scripts", "testcases")
|
||||
|
||||
#Directory containing the website's test harness (ported over from TEST262_HARNESS_DIR)
|
||||
TEST262_WEB_HARNESS_DIR = os.path.join(TEST262_ROOT, "website", "resources", "scripts", "global")
|
||||
|
||||
#Path to the ported test case files on the actual website as opposed to the Hg layout
|
||||
WEBSITE_CASES_PATH = "resources/scripts/testcases/"
|
||||
|
||||
#The name of a file which contains a list of tests which should be disabled in test262.
|
||||
#These tests are either invalid as-per ES5 or have issues with the test262 web harness.
|
||||
EXCLUDED_FILENAME = os.path.join(TEST262_ROOT, "test", "config", "excludelist.xml")
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
TEMPLATE_LINES = None
|
||||
__lastHarnessType = None
|
||||
|
||||
def generateHarness(harnessType, jsonName, title):
|
||||
global TEMPLATE_LINES
|
||||
global __lastHarnessType
|
||||
if TEMPLATE_LINES==None or harnessType!=__lastHarnessType:
|
||||
__lastHarnessType = harnessType
|
||||
TEMPLATE_LINES = []
|
||||
with open(os.path.join(os.getcwd(), "templates","runner." + harnessType + ".html"), "r") as f:
|
||||
TEMPLATE_LINES = f.readlines()
|
||||
fileName = os.path.join(TEST262_ROOT, "website", jsonName.replace(".json", ".html"))
|
||||
fileNameExists = False
|
||||
if os.path.exists(fileName):
|
||||
SC_HELPER.edit(fileName)
|
||||
fileNameExists = True
|
||||
with open(fileName, "w") as f:
|
||||
for line in TEMPLATE_LINES:
|
||||
if "var TEST_LIST_PATH =" in line:
|
||||
f.write(" var TEST_LIST_PATH = \"resources/scripts/testcases/" + jsonName + "\";" + os.linesep)
|
||||
#elif "ECMAScript 5" in line:
|
||||
# f.write(line.replace("ECMAScript 5", "ECMAScript 5: %s" % title))
|
||||
else:
|
||||
f.write(line)
|
||||
if not fileNameExists:
|
||||
SC_HELPER.add(fileName)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
class SCAbstraction(object):
|
||||
'''
|
||||
A class which abstracts working with source control systems in relation to
|
||||
generated test262 files. Useful when test262 is also used internally by
|
||||
browser implementors.
|
||||
'''
|
||||
def edit(self, filename):
|
||||
'''
|
||||
Source control edit of a file. For Mercurial, just make sure it's
|
||||
writable.
|
||||
'''
|
||||
if not(os.stat(filename).st_mode & stat.S_IWRITE):
|
||||
os.chmod(filename, stat.S_IWRITE)
|
||||
|
||||
def add(self, filename):
|
||||
'''
|
||||
Source control add of a file.
|
||||
'''
|
||||
subprocess.call(["hg", "add", filename])
|
||||
|
||||
SC_HELPER = SCAbstraction()
|
Binary file not shown.
|
@ -1,170 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
|
||||
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||
<script type="text/javascript" src="resources/scripts/global/jquery-1.4.2.min.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sections.js"></script>
|
||||
<script type="text/javascript">
|
||||
//Globals
|
||||
var TEST_LIST_PATH = "resources/scripts/testcases/testcaseslist.json";
|
||||
</script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sth.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sta.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/jqueryprogressbar.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/helper.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/jquery.base64.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sputnikLib.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/testcases/SputnikGlobalScope.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/testcases/IETCGlobalScope.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
//To support all the browsers
|
||||
$(window).resize(ResizeLoadIndicator);
|
||||
$(window).load(ResizeLoadIndicator);
|
||||
function ResizeLoadIndicator() {
|
||||
$(".indicatorContainer .disabledBackground").css({ height: ($(window).height() - 20) + "px" });
|
||||
}
|
||||
|
||||
$(".indicatorContainer").click(function(e) {
|
||||
if (!e) { var e = window.event; }
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation) { e.stopPropagation(); }
|
||||
});
|
||||
</script>
|
||||
|
||||
<title>ECMAScript Test262</title>
|
||||
<link href="resources/styles/style.css" media="screen" rel="stylesheet" title="CSS" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="indicatorContainer" oncontextmenu="return false;">
|
||||
<!--Blank div to disable back portion when indicator is shown-->
|
||||
<div class="disabledBackground"></div>
|
||||
<div id="loadingIndicator">
|
||||
<div>
|
||||
<img src="./resources/images/spinner.gif" alt="Loading..." />
|
||||
<span>Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wrapper">
|
||||
<!-- This Container holds the Logo -->
|
||||
<div class="logoHeader">
|
||||
<div class="logoBg"><img src="resources/images/logo.png" /></div>
|
||||
<div class="ecmascriptbacklink">
|
||||
<p><a href='javascript:void(window.open("http://www.ecmascript.org/"));'>ECMAScript.org</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- This Container holds the Navigation -->
|
||||
<div class="navBar">
|
||||
<ul>
|
||||
<li><a href="#" class="selected nav-link" id="home">Home</a></li>
|
||||
<li><a href="#" class="nav-link" id="run">Run</a></li>
|
||||
<li><a href="#" class="nav-link test-report-link" id="results">Results</a></li>
|
||||
<li><a href="#" class="nav-link" id="development">Development</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="content-container" id="contentContainer">
|
||||
<!-- This is the Main Content Container -->
|
||||
<div class="content-home">
|
||||
<p class="headers">What is test262?</p>
|
||||
<p class="content">test262 is a test suite intended to check agreement between JavaScript implementations and the ECMA-262 Specification (currently 5th Edition). The test suite contains thousands of individual tests, each of which tests some specific requirements of the ECMAScript specification.</p>
|
||||
<p class="headers">What is ECMAScript?</p>
|
||||
<p class="content">"ECMAScript" is the name under which the language more commonly known as "JavaScript" is standardized. Development of the ECMAScript standard is the responsibility of <a href='javascript:void(window.open("http://www.ecma-international.org/memento/TC39.htm"));'>Technical Committee 39 (TC39)</a> of <a href='javascript:void(window.open("http://www.ecma-international.org/"));'>Ecma International</a>. The ECMAScript standard is officially known as ECMA-262. ECMAScript 5 (or just ES5) is short hand for the "ECMA-262, 5th Edition ECMAScript Language Specification" the official name of the current edition of the standard. ECMAScript 5 was approved as an official Ecma standard by the Ecma General Assembly on December 3, 2009. <a href='javascript:void(window.open("http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"));'>The ECMAScript 5 Specification (PDF)</a> is available from the Ecma International web site.</p>
|
||||
<p class="headers">Who creates and maintains test262?</p>
|
||||
<p class="content">Development of test262 is a project of Ecma TC39. The testing framework and individual tests are created by member organizations of TC39 and contributed to Ecma for use in test262. For more information about how test262 is developed and maintained click the “Development” tab at the top of this page.</p>
|
||||
<p class="headers">What is the status of test262?</p>
|
||||
<p class="content"><strong>test262 is not yet complete. It is still undergoing active development.</strong> Some portions of the ES5 specification have very complete test coverage while other portions of the specification have only partial test coverage. Some tests may be invalid or may yield false positive or false negative results. A perfect passing score on test262 does not guarantee that a JavaScript implementation perfectly supports ES5. Because tests are being actively added and modified, tests results from different days or times may not be directly comparable. Click the “Development” tab at the top of this page for instructions for reporting test262 bugs.</p>
|
||||
<p class="headers">Where can I found out more?</p>
|
||||
<p class="content">Please visit our <a href='javascript:void(window.open("http://wiki.ecmascript.org/doku.php?id=test262:faq"));'>Frequently Asked Questions</a> section on the <a href='javascript:void(window.open("http://wiki.ecmascript.org/doku.php?id="));'>ECMAScript Wiki</a>.</p>
|
||||
|
||||
<p class="headers">Running the Tests</p>
|
||||
<p class="content">Click the “Run” tab at the top of this page for instructions and follow the instructions to run the tests.</p>
|
||||
|
||||
<a href='javascript:void(window.open("http://www.ecma-international.org/memento/TC39.htm"));'></a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content-dev">
|
||||
<p class="headers">Development</p>
|
||||
<p class="content">Test262 is being developed by the members of Ecma TC39. Ecma's intellectual property policies, permit only Ecma
|
||||
members to directly contribute code to the project. However, a <a href='javascript:void(window.open("http://mail.mozilla.org/pipermail/test262-discuss/"));'>public mailing list</a> is used to coordinate development of Test262. If you wish to participate in the discussion please <a href='javascript:void(window.open("http://mail.mozilla.org/listinfo/test262-discuss"));'>subscribe</a>. Bug reports and suggestions should be sent to the mailing list.
|
||||
</p>
|
||||
<p class="content">
|
||||
Ecma members can find detailed instructions on Test262 development procedures at the <a href='javascript:void(window.open("http://wiki.ecmascript.org/doku.php?id=test262:test262"));'>Test262 Wiki</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="content-tests">
|
||||
<!-- This is the Main Content Container -->
|
||||
<p class="content">Please click on the Start button to start the test. Once you start the test you may pause the test anytime by clicking on the Pause button. You can click on the Results tab once the test is completed or after pausing the test. The Reset button is for restarting the test run.</p>
|
||||
<!--
|
||||
<div class="progressBarHolder">
|
||||
Chapter Index: <input type="text" size="2" maxlength="2" value="" id="chapterId" onkeypress="if(event.keyCode < 48 || event.keyCode > 57){return false;}"/>
|
||||
</div>
|
||||
-->
|
||||
<!-- This is the Progress Bar Holder -->
|
||||
<div class="progressBarHolder">
|
||||
<div id="progressbar"></div>
|
||||
<div class="progressBarButtons">
|
||||
<img src="resources/images/reset.png" class="button-reset"/> <img src="resources/images/start.png" class="button-start" id="btnStart"/>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
<p class="hide">>
|
||||
Timer Value(ms) : <input id="txtTimerValue" value="50" /> <input id="btnSetTimerValue" value="Set Timer Value" type="button"/>
|
||||
</p>
|
||||
<!-- This is the Results Text Holder -->
|
||||
<div class="resultsHeader">
|
||||
<!--Total Loaded: <strong><span id="totalLoadedCounter"></span></strong><span class="Separator">|</span>-->
|
||||
Tests To Run: <strong><span class="teststorun-counter" id="testsToRun"></span></strong> <span class="separator">|</span>
|
||||
Total Tests Ran: <strong><span class="total-counter" id="totalCounter"></span></strong> <span class="separator">|</span> Pass: <span class="pass" id="Pass"></span> <span class="separator">|</span> Fail: <span class="fail" id="Fail"></span>
|
||||
<span class="separator">|</span> Failed To Load: <span class="fail" id="failedToLoadCounter1"></span>
|
||||
<p><span id="nextActivity"></span></p>
|
||||
</div>
|
||||
<!-- This is the Table -->
|
||||
<div class="resultsTableHolder" id="tableLoggerParent">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-logger" id="tableLogger"></table>
|
||||
</div>
|
||||
<div>
|
||||
Test Suite Ver.: <span class="targetTestSuiteVersion"></span> <span class="separator">|</span> Test Suite Date: <span class="targetTestSuiteDate"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-results">
|
||||
<div class="crumbContainer">
|
||||
<div class="crumbs"></div>
|
||||
<div style="float:right;"><a class="setBlue hide" id="backlinkDiv" href="#"><< back</a></div>
|
||||
<div style="clear : both;"></div>
|
||||
</div>
|
||||
<div class="resultsHeader"> <strong>Total Tests:<span class="totalCases"></span></strong><br />
|
||||
Passed: <span class="passedCases"></span> <span class="separator">|</span> Failed: <span class="failedCases"></span> <span class="separator">|</span>
|
||||
Failed To Load: <strong><span id="failedToLoadCounter"></span></strong>
|
||||
</div>
|
||||
<!-- This is the Table -->
|
||||
<div class="resultsTableHolder">
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="results-data-table"> </table>
|
||||
<div id="resultMessage">Test results will be displayed after the tests are executed using the Run page.</div>
|
||||
</div>
|
||||
<div>
|
||||
Test Suite Ver.: <span class="targetTestSuiteVersion"></span> <span class="separator">|</span> Test Suite Date: <span class="targetTestSuiteDate"></span>
|
||||
</div>
|
||||
<div class="downloadLinks">
|
||||
<p><a class="anchor-download-xml" id="ancGenXMLReport"><strong>Download results as XML</strong></a></p> <!--| <strong><a href="resources/scripts/testcases.zip">Download Source</a></strong></p>-->
|
||||
</div>
|
||||
<div id="legend" class="hide">
|
||||
<label class="reportGreen">Green:</label> 100%
|
||||
<label class="reportLightGreen">Green:</label> 75% to 99.9%
|
||||
<label class="reportYellow">Yellow:</label> 50% to 75%
|
||||
<label class="reportRed">Red:</label> less than 50%
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- This is the Footer -->
|
||||
<div class="footer">
|
||||
<!--<div class="Links"> <a href="">Privacy</a> | <a href="">Terms of Use</a> </div>-->
|
||||
<div class="copyright"> © <a href='javascript:void(window.open("http://www.ecma-international.org"));'>Ecma International</a> </div>
|
||||
</div>
|
||||
<iframe id="scriptLoader" class="hide"></iframe>
|
||||
</body>
|
||||
</html>
|
|
@ -38,7 +38,7 @@ def generateHarness(harnessType, jsonFile, description):
|
|||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
from TestCasePackagerConfig import *
|
||||
from packagerConfig import *
|
||||
|
||||
#--Globals---------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import stat
|
|||
#--Globals---------------------------------------------------------------------
|
||||
MAX_CASES_PER_JSON = 1000
|
||||
|
||||
WEBSITE_SHORT_NAME = "website2"
|
||||
WEBSITE_SHORT_NAME = "website"
|
||||
|
||||
#Directories under "test\suite\" containing ES5 test chapter directories
|
||||
#with *.js tests underneath them
|
|
@ -2,20 +2,18 @@
|
|||
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||
<script type="text/javascript" src="resources/scripts/global/jquery-1.4.2.min.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sections.js"></script>
|
||||
<script type="text/javascript" src="harness/jquery-1.4.2.min.js"></script>
|
||||
<script type="text/javascript" src="harness/sections.js"></script>
|
||||
<script type="text/javascript">
|
||||
//Globals
|
||||
var TEST_LIST_PATH = "resources/scripts/testcases/default.json";
|
||||
var TEST_LIST_PATH = "json/default.json";
|
||||
</script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sth.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sta.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/jqueryprogressbar.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/helper.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/jquery.base64.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/global/sputnikLib.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/testcases/SputnikGlobalScope.js"></script>
|
||||
<script type="text/javascript" src="resources/scripts/testcases/IETCGlobalScope.js"></script>
|
||||
<script type="text/javascript" src="harness/sth.js"></script>
|
||||
<script type="text/javascript" src="harness/sta.js"></script>
|
||||
<script type="text/javascript" src="harness/jqueryprogressbar.js"></script>
|
||||
<script type="text/javascript" src="harness/helper.js"></script>
|
||||
<script type="text/javascript" src="harness/jquery.base64.js"></script>
|
||||
<script type="text/javascript" src="harness/sputnikLib.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
//To support all the browsers
|
||||
$(window).resize(ResizeLoadIndicator);
|
||||
|
@ -32,7 +30,7 @@
|
|||
</script>
|
||||
|
||||
<title>ECMAScript Test262</title>
|
||||
<link href="resources/styles/style.css" media="screen" rel="stylesheet" title="CSS" type="text/css" />
|
||||
<link href="styles/style.css" media="screen" rel="stylesheet" title="CSS" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="indicatorContainer" oncontextmenu="return false;">
|
||||
|
@ -40,7 +38,7 @@
|
|||
<div class="disabledBackground"></div>
|
||||
<div id="loadingIndicator">
|
||||
<div>
|
||||
<img src="./resources/images/spinner.gif" alt="Loading..." />
|
||||
<img src="./images/spinner.gif" alt="Loading..." />
|
||||
<span>Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -49,7 +47,7 @@
|
|||
<div class="wrapper">
|
||||
<!-- This Container holds the Logo -->
|
||||
<div class="logoHeader">
|
||||
<div class="logoBg"><img src="resources/images/logo.png" /></div>
|
||||
<div class="logoBg"><img src="images/logo.png" /></div>
|
||||
<div class="ecmascriptbacklink">
|
||||
<p><a href='javascript:void(window.open("http://www.ecmascript.org/"));'>ECMAScript.org</a></p>
|
||||
</div>
|
||||
|
@ -106,7 +104,7 @@
|
|||
<div class="progressBarHolder">
|
||||
<div id="progressbar"></div>
|
||||
<div class="progressBarButtons">
|
||||
<img src="resources/images/reset.png" class="button-reset"/> <img src="resources/images/start.png" class="button-start" id="btnStart"/>
|
||||
<img src="images/reset.png" class="button-reset"/> <img src="images/start.png" class="button-start" id="btnStart"/>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
||||
|
@ -149,7 +147,7 @@
|
|||
Test Suite Ver.: <span class="targetTestSuiteVersion"></span> <span class="separator">|</span> Test Suite Date: <span class="targetTestSuiteDate"></span>
|
||||
</div>
|
||||
<div class="downloadLinks">
|
||||
<p><a class="anchor-download-xml" id="ancGenXMLReport"><strong>Download results as XML</strong></a></p> <!--| <strong><a href="resources/scripts/testcases.zip">Download Source</a></strong></p>-->
|
||||
<p><a class="anchor-download-xml" id="ancGenXMLReport"><strong>Download results as XML</strong></a></p> <!--| <strong><a href="scripts/testcases.zip">Download Source</a></strong></p>-->
|
||||
</div>
|
||||
<div id="legend" class="hide">
|
||||
<label class="reportGreen">Green:</label> 100%
|
||||
|
|
|
@ -22,29 +22,31 @@
|
|||
|
||||
//An exception is expected
|
||||
if (testDescrip.negative !== undefined) {
|
||||
//TODO - come up with a generic way of catching the error type from window.onerror
|
||||
testDescrip.negative = testDescrip.negative === "NotEarlyError" ? testDescrip.negative : ".";
|
||||
if (window.iframeError === undefined) { //no exception was thrown
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code, typeof testDescrip.precondition !== 'undefined' ? testDescrip.precondition.toString() : '',
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
|
||||
'fail',
|
||||
Error('No exception was thrown; expected an error "message" property matching the regular expression "' + testDescrip.negative + '".'));
|
||||
} else if (!(new RegExp(testDescrip.negative, "i").test(window.iframeError))) { //wrong type of exception thrown
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code, typeof testDescrip.precondition !== 'undefined' ? testDescrip.precondition.toString() : '',
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
|
||||
'fail',
|
||||
Error('Expected an exception with a "message" property matching the regular expression "' + testDescrip.negative +'" to be thrown; actual was "' + window.iframeError + '".'));
|
||||
} else {
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code, typeof testDescrip.precondition !== 'undefined' ? testDescrip.precondition.toString() : '',
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
|
||||
'pass', undefined);
|
||||
}
|
||||
}
|
||||
|
||||
//Exception was not expected to be thrown
|
||||
else if (window.iframeError !== undefined) {
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code, typeof testDescrip.precondition !== 'undefined' ? testDescrip.precondition.toString() : '',
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
|
||||
'fail',
|
||||
Error('Unexpected exception, "' + window.iframeError + '" was thrown.'));
|
||||
}
|
||||
|
||||
else {
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code, typeof testDescrip.precondition !== 'undefined' ? testDescrip.precondition.toString() : '',
|
||||
testRun(testDescrip.id, testDescrip.path, testDescrip.description, testDescrip.code,
|
||||
'pass', undefined);
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ function Presenter() {
|
|||
totalTests = 0;
|
||||
|
||||
var progressBar;
|
||||
TOCFILEPATH = "resources/scripts/global/ecma-262-toc.xml";
|
||||
TOCFILEPATH = "metadata/ecma-262-toc.xml";
|
||||
//**INTERFACE****************************************************************
|
||||
/* Updates progress with the given test, which should have its results in it as well. */
|
||||
this.addTestResult = function(test) {
|
||||
|
@ -69,7 +69,7 @@ function Presenter() {
|
|||
}
|
||||
|
||||
this.finished = function(elapsed) {
|
||||
$('.button-start').attr('src', 'resources/images/start.png');
|
||||
$('.button-start').attr('src', 'images/start.png');
|
||||
$('.button-start').fadeOut('fast');
|
||||
|
||||
progressBar.find(".text").html("Testing complete!");
|
||||
|
@ -81,11 +81,11 @@ function Presenter() {
|
|||
}
|
||||
|
||||
this.started = function () {
|
||||
$('.button-start').attr('src', 'resources/images/pause.png');
|
||||
$('.button-start').attr('src', 'images/pause.png');
|
||||
}
|
||||
|
||||
this.paused = function () {
|
||||
$('.button-start').attr('src', 'resources/images/resume.png');
|
||||
$('.button-start').attr('src', 'images/resume.png');
|
||||
}
|
||||
|
||||
this.reset = function() {
|
||||
|
@ -160,11 +160,6 @@ function Presenter() {
|
|||
innerHTML += '<br /><br /><br /><b>Testcase</b>';
|
||||
innerHTML += '<pre>' + test.code + '</pre>';
|
||||
|
||||
if (test.pre) {
|
||||
innerHTML += '<b>Precondition</b>';
|
||||
innerHTML += '<pre>' + test.pre + '</pre>';
|
||||
}
|
||||
|
||||
innerHTML += '<b>Path</b>';
|
||||
innerHTML += '<pre>' + test.path + ' </pre> ';
|
||||
|
|
@ -285,41 +285,8 @@ var EarlyErrorRePat = "^((?!" + NotEarlyErrorString + ").)*$";
|
|||
var NotEarlyError = new Error(NotEarlyErrorString);
|
||||
|
||||
//--Test case registration-----------------------------------------------------
|
||||
var ES5Harness = {};
|
||||
ES5Harness.registerTest = function (test) {
|
||||
var error;
|
||||
//Has a test precondition set, but the precondition fails
|
||||
if (test.precondition && !test.precondition()) {
|
||||
testRun(test.id, test.path, test.description, test.test.toString(),
|
||||
typeof test.precondition !== 'undefined' ? test.precondition.toString() : '',
|
||||
'fail', Error('Precondition Failed'));
|
||||
}
|
||||
//We're good to actually run the test case
|
||||
else {
|
||||
try {
|
||||
if (test.strict!==undefined) {
|
||||
var res = test.test();
|
||||
} else {
|
||||
var res = test.test.call(window);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
res = 'fail';
|
||||
error = e;
|
||||
if (!(e instanceof Error)) {
|
||||
try {
|
||||
error = Error(e.toString());
|
||||
} catch (e2) {
|
||||
error = Error("test262: unknown error in test case or ECMAScript implementation");
|
||||
}
|
||||
}
|
||||
}
|
||||
//Sputnik and IE Test Center tests are a bit different in terms of return values.
|
||||
//That is, IE Test Center will always return 'true' IFF the test passed. Sputnik
|
||||
//test cases will return either 'true' or 'undefined' if they pass.
|
||||
var retVal = /^s/i.test(test.id) ? (res === true || typeof res === 'undefined' ? 'pass' : 'fail') : (res === true ? 'pass' : 'fail');
|
||||
testRun(test.id, test.path, test.description, test.test.toString(),
|
||||
typeof test.precondition !== 'undefined' ? test.precondition.toString() : '',
|
||||
retVal, error);
|
||||
function runTestCase(testcase) {
|
||||
if (testcase() !== true) {
|
||||
$ERROR("Test case returned non-true value!")
|
||||
}
|
||||
}
|
|
@ -41,7 +41,7 @@ function BrowserRunner() {
|
|||
errorDetectorFileContents,
|
||||
simpleTestAPIContents,
|
||||
globalScopeContents,
|
||||
harnessDir = "resources/scripts/global/";
|
||||
harnessDir = "harness/";
|
||||
|
||||
$.ajax({async: false,
|
||||
dataType: "text",
|
||||
|
@ -87,31 +87,31 @@ function BrowserRunner() {
|
|||
}
|
||||
|
||||
/* Called from the child window after the test has run. */
|
||||
function testRun(id, path, description, codeString, preconditionString, result, error) {
|
||||
function testRun(id, path, description, codeString, result, error) {
|
||||
currentTest.id = id;
|
||||
currentTest.path = path;
|
||||
currentTest.description = description;
|
||||
currentTest.result = result;
|
||||
currentTest.error = error;
|
||||
currentTest.code = codeString;
|
||||
currentTest.pre = preconditionString;
|
||||
}
|
||||
|
||||
|
||||
/* Run the test. */
|
||||
this.run = function (test, code) {
|
||||
currentTest = { id: test.id,
|
||||
path: test.path,
|
||||
code: code,
|
||||
}; // default test, in case it doesn't get registered.
|
||||
|
||||
var isGlobalTest = GlobalScopeTests[test.path] !== undefined;
|
||||
|
||||
currentTest = {};
|
||||
for (var tempIndex in test) {
|
||||
if (test.hasOwnProperty(tempIndex)) {
|
||||
currentTest[tempIndex] = test[tempIndex];
|
||||
}
|
||||
}
|
||||
currentTest.code = code;
|
||||
|
||||
iframe = document.createElement("iframe");
|
||||
iframe.setAttribute("id", "runnerIframe");
|
||||
iframe.setAttribute("id", "runnerIframe");
|
||||
//FireFox has a defect where it doesn't fire window.onerror for an iframe if the iframe
|
||||
//is invisible.
|
||||
if (!isGlobalTest || !/firefox/i.test(navigator.userAgent)) {
|
||||
if (!/firefox/i.test(navigator.userAgent)) {
|
||||
iframe.setAttribute("style", "display:none");
|
||||
}
|
||||
document.body.appendChild(iframe);
|
||||
|
@ -129,23 +129,23 @@ function BrowserRunner() {
|
|||
include;
|
||||
iwin.Test262Error = Test262Error;
|
||||
iwin.$ERROR = $ERROR;
|
||||
iwin.$FAIL = $FAIL;
|
||||
iwin.$PRINT = function () {};
|
||||
iwin.$INCLUDE = function() {};
|
||||
iwin.$FAIL = $FAIL;
|
||||
iwin.$PRINT = function () { };
|
||||
iwin.$INCLUDE = function () { };
|
||||
|
||||
if(includes !== null) {
|
||||
if (includes !== null) {
|
||||
// We have some includes, so loop through each include and
|
||||
// pull in the dependencies.
|
||||
for(var i = 0; i < includes.length; i++) {
|
||||
for (var i = 0; i < includes.length; i++) {
|
||||
include = includes[i].replace(/.*\(('|")(.*)('|")\)/, "$2");
|
||||
|
||||
// First check to see if we have this script cached
|
||||
// already, and if not, grab it.
|
||||
if(typeof scriptCache[include] === "undefined") {
|
||||
if (typeof scriptCache[include] === "undefined") {
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: 'resources/scripts/global/' + include,
|
||||
success: function(s) { scriptCache[include] = s; }
|
||||
url: 'harness/' + include,
|
||||
success: function (s) { scriptCache[include] = s; }
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -160,42 +160,30 @@ function BrowserRunner() {
|
|||
idoc.writeln(simpleTestAPIContents);
|
||||
idoc.writeln("</script>");
|
||||
|
||||
//--Scenario 1: we're dealing with a global scope test case
|
||||
if (isGlobalTest) {
|
||||
iwin.iframeError = undefined;
|
||||
iwin.onerror = undefined;
|
||||
var testDescrip = GlobalScopeTests[test.path];
|
||||
testDescrip.id = test.id;
|
||||
testDescrip.path = test.path;
|
||||
testDescrip.code = code;
|
||||
iwin.testDescrip = testDescrip;
|
||||
|
||||
//Add an error handler capable of catching so-called early errors
|
||||
//idoc.writeln("<script type='text/javascript' src='harness/ed.js'>" + "</script>");
|
||||
idoc.writeln("<script type='text/javascript'>");
|
||||
idoc.writeln(errorDetectorFileContents);
|
||||
idoc.writeln("</script>");
|
||||
iwin.iframeError = undefined;
|
||||
iwin.onerror = undefined;
|
||||
iwin.testDescrip = currentTest;
|
||||
|
||||
//Run the code
|
||||
idoc.writeln("<script type='text/javascript'>");
|
||||
if (/opera/i.test(navigator.userAgent)) { //Opera doesn't support window.onerror
|
||||
idoc.writeln("try {eval(\"" + this.convertForEval(code) + "\");} catch(e) {window.onerror(e.toString(), null, null);}");
|
||||
} else {
|
||||
idoc.writeln(code);
|
||||
}
|
||||
idoc.writeln("</script>");
|
||||
|
||||
//Validate the results
|
||||
//idoc.writeln("<script type='text/javascript' src='harness/gs.js' defer>" + "</script>");
|
||||
idoc.writeln("<script type='text/javascript'>");
|
||||
idoc.writeln(globalScopeContents);
|
||||
idoc.writeln("</script>");
|
||||
}
|
||||
//--Scenario 2: we're dealing with a normal positive(?) test case
|
||||
else {
|
||||
idoc.writeln("<script type='text/javascript'>" + code + "</script>");
|
||||
idoc.writeln("<script type='text/javascript' defer>testFinished();" + "</script>");
|
||||
//Add an error handler capable of catching so-called early errors
|
||||
//idoc.writeln("<script type='text/javascript' src='harness/ed.js'>" + "</script>");
|
||||
idoc.writeln("<script type='text/javascript'>");
|
||||
idoc.writeln(errorDetectorFileContents);
|
||||
idoc.writeln("</script>");
|
||||
|
||||
//Run the code
|
||||
idoc.writeln("<script type='text/javascript'>");
|
||||
if (/opera/i.test(navigator.userAgent)) { //Opera doesn't support window.onerror
|
||||
idoc.writeln("try {eval(\"" + this.convertForEval(code) + "\");} catch(e) {window.onerror(e.toString(), null, null);}");
|
||||
} else {
|
||||
idoc.writeln(code);
|
||||
}
|
||||
idoc.writeln("</script>");
|
||||
|
||||
//Validate the results
|
||||
//idoc.writeln("<script type='text/javascript' src='harness/gs.js' defer>" + "</script>");
|
||||
idoc.writeln("<script type='text/javascript'>");
|
||||
idoc.writeln(globalScopeContents);
|
||||
idoc.writeln("</script>");
|
||||
idoc.close();
|
||||
}
|
||||
|
||||
|
@ -279,6 +267,21 @@ function TestLoader() {
|
|||
}});
|
||||
}
|
||||
|
||||
function getIdFromPath (path) {
|
||||
//path is of the form "a/b/c.js"
|
||||
|
||||
var id = path.split("/");
|
||||
//id is now of the form ["a", "b", "c.js"];
|
||||
|
||||
id = id[id.length-1];
|
||||
//id is now of the form "c.js"
|
||||
|
||||
id = id.replace(/\.js$/i, "");
|
||||
//id is now of the form "c"
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/* Move on to the next test */
|
||||
this.getNextTest = function() {
|
||||
if(testGroups.length == 0) {
|
||||
|
@ -287,7 +290,8 @@ function TestLoader() {
|
|||
} else if(currentTestIndex < testGroups[testGroupIndex].tests.length) {
|
||||
// We have tests left in this test group.
|
||||
var test = testGroups[testGroupIndex].tests[currentTestIndex++];
|
||||
var scriptCode = test.code;
|
||||
var scriptCode = test.code;
|
||||
test.id = getIdFromPath(test.path);
|
||||
//var scriptCode = (test.firstChild.text != undefined) ?
|
||||
// test.firstChild.text : test.firstChild.textContent;
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"testsCollection":{"name":"Chapter - 15.12_The_JSON_Object","numTests":"1","tests":[{"code":"Ly8gQ29weXJpZ2h0IDIwMTEgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8vIFRoaXMgY29kZSBpcyBnb3Zlcm5lZCBieSB0aGUgQlNEIGxpY2Vuc2UgZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZS4KCi8qKgogKiBKU09OLnBhcnNlIG11c3QgY3JlYXRlIGEgcHJvcGVydHkgd2l0aCB0aGUgZ2l2ZW4gcHJvcGVydHkgbmFtZQogKgogKiBAcGF0aCAxNV9OYXRpdmUvMTUuMTJfVGhlX0pTT05fT2JqZWN0LzE1LjEyLjJfSlNPTi5wYXJzZS9TMTUuMTIuMl9BMS5qcwogKiBAZGVzY3JpcHRpb24gVGVzdHMgdGhhdCBKU09OLnBhcnNlIHRyZWF0cyAiX19wcm90b19fIiBhcyBhIHJlZ3VsYXIgcHJvcGVydHkgbmFtZQogKi8KCnZhciB4ID0gSlNPTi5wYXJzZSgneyJfX3Byb3RvX18iOltdfScpOwppZiAoT2JqZWN0LmdldFByb3RvdHlwZU9mKHgpICE9PSBPYmplY3QucHJvdG90eXBlKSB7CiAgJEZBSUwoJyMxOiBKU09OLnBhcnNlIGNvbmZ1c2VkIGJ5ICJfX3Byb3RvX18iJyk7Cn0KaWYgKCFBcnJheS5pc0FycmF5KHguX19wcm90b19fKSkgewogICRGQUlMKCcjMjogSlNPTi5wYXJzZSBkaWQgbm90IHNldCAiX19wcm90b19fIiBhcyBhIHJlZ3VsYXIgcHJvcGVydHknKTsKfQoK","commentary":"JSON.parse must create a property with the given property name","description":"Tests that JSON.parse treats \"__proto__\" as a regular property name","path":"TestCases/converted/15_Native/15.12_The_JSON_Object/15.12.2_JSON.parse/S15.12.2_A1.js"}]}}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"testsCollection":{"name":"Chapter - 15.2.3.1","numTests":"1","tests":[{"code":"Ly8vIENvcHlyaWdodCAoYykgMjAwOSBNaWNyb3NvZnQgQ29ycG9yYXRpb24gCi8vLyAKLy8vIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dCBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQKLy8vIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6IAovLy8gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodCBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZAovLy8gICAgICB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuIAovLy8gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodCBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCAKLy8vICAgICAgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZSBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLiAgCi8vLyAgICAqIE5laXRoZXIgdGhlIG5hbWUgb2YgTWljcm9zb2Z0IG5vciB0aGUgbmFtZXMgb2YgaXRzIGNvbnRyaWJ1dG9ycyBtYXkgYmUgdXNlZCB0bwovLy8gICAgICBlbmRvcnNlIG9yIHByb21vdGUgcHJvZHVjdHMgZGVyaXZlZCBmcm9tIHRoaXMgc29mdHdhcmUgd2l0aG91dCBzcGVjaWZpYyBwcmlvciB3cml0dGVuIHBlcm1pc3Npb24uCi8vLyAKLy8vIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgIkFTIElTIiBBTkQgQU5ZIEVYUFJFU1MgT1IKLy8vIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRSBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTCi8vLyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIFRIRSBDT1BZUklHSFQgT1dORVIgT1IgQ09OVFJJQlVUT1JTIEJFIExJQUJMRQovLy8gRk9SIEFOWSBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyAoSU5DTFVESU5HLCBCVVQgTk9UCi8vLyBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MKLy8vIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLAovLy8gT1IgVE9SVCAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0YgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRgovLy8gQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuCgovKioKICogQHBhdGggY2hhcHRlcjE1LzE1LjIvMTUuMi4zLzE1LjIuMy4xLzE1LjIuMy4xLmpzCiAqIEBkZXNjcmlwdGlvbiBPYmplY3QucHJvdG90eXBlIGlzIGEgZGF0YSBwcm9wZXJ0eSB3aXRoIGRlZmF1bHQgYXR0cmlidXRlIHZhbHVlcyAoZmFsc2UpCiAqLwoKCmZ1bmN0aW9uIHRlc3RjYXNlKCkgewogIHZhciBkZXNjID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihPYmplY3QsICdwcm90b3R5cGUnKTsKICBpZiAoZGVzYy53cml0YWJsZSA9PT0gZmFsc2UgJiYKICAgICAgZGVzYy5lbnVtZXJhYmxlID09PSBmYWxzZSAmJgogICAgICBkZXNjLmNvbmZpZ3VyYWJsZSA9PT0gZmFsc2UpIHsKICAgIHJldHVybiB0cnVlOwogIH0KIH0KcnVuVGVzdENhc2UodGVzdGNhc2UpOwo=","commentary":"","description":"Object.prototype is a data property with default attribute values (false)","path":"TestCases/converted/chapter15/15.2/15.2.3/15.2.3.1/15.2.3.1.js"}]}}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue