diff --git a/tools/SputnikConverter/ES5TestCase.cs b/tools/SputnikConverter/ES5TestCase.cs index c466f4ed73d0be91983cf3ad3072e8c3627cf969..1b2a63854f722ea2b395ce86cf249b2688f3ff1f 100644 --- a/tools/SputnikConverter/ES5TestCase.cs +++ b/tools/SputnikConverter/ES5TestCase.cs @@ -2,8 +2,11 @@ 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 @@ -11,8 +14,12 @@ namespace Microsoft.Sputnik.Interop.ParserEngine { public static class ES5TestScript { - private static int fileCounter; + private static int fileCounter; + private static StringBuilder negativeTestCases; + private static string[] templates = { + + ES5TestScript.GetTemplateFile(ResourceClass.BasicTemplate_FileName), ES5TestScript.GetTemplateFile(ResourceClass.BasicPrereqTemplate_FileName), ES5TestScript.GetTemplateFile(ResourceClass.BasicNegativeTemplate_FileName), @@ -43,6 +50,8 @@ namespace Microsoft.Sputnik.Interop.ParserEngine int indexOfRoot = script.FullPath.IndexOf(root, StringComparison.InvariantCulture); string pathFromRoot = script.FullPath.Substring(indexOfRoot, script.FullPath.Length - indexOfRoot); string destDir = Path.Combine(destinationPath, Path.GetDirectoryName(pathFromRoot)); + string positiveDestDir = destDir.Replace("conformance", ""); + string negativeDestDir = destDir.Replace("conformance", "GlobalScope"); // int fileCounter = 0; string buildContent = string.Empty; string destFullPath = string.Empty; @@ -52,7 +61,12 @@ namespace Microsoft.Sputnik.Interop.ParserEngine if (script.IsNegative) { templateIndex += 2; - if (!body.Contains("eval(")) body = WrapWithEval(body); + destDir = negativeDestDir; + //if (!body.Contains("eval(")) body = WrapWithEval(body); + } + else + { + destDir = positiveDestDir; } string template = templates[templateIndex]; Logger.WriteToLog("====================================================================================="); @@ -69,7 +83,8 @@ namespace Microsoft.Sputnik.Interop.ParserEngine // OutputFileCounter = OutputFileCounter + script.ConvertedFileCount; // foreach (string check in script.Checks) // { - string[] args = { script.Header,script.Id, script.SectionName, InsertStringEscapes(script.Description), script.ReplicationCode, body, preCondition }; + + string[] args = { script.Header, script.Id, script.SectionName, InsertStringEscapes(script.Assertion), InsertStringEscapes(script.Description), script.ReplicationCode, body, preCondition, script.InitialComment }; // ++fileCounter; // if (script.Checks.Length > 1) // { @@ -93,6 +108,29 @@ namespace Microsoft.Sputnik.Interop.ParserEngine writeTestCase.Close(); OutputFileCounter++; } + + if (script.IsNegative) + { + //Add details in stringbuilder. + string folderPath = GetPartialPath(destFullPath,3); + StringBuilder sb = new StringBuilder(); + sb.Append("\"GlobalScope/" + script.SectionName + "/" + script.Id + ".js\""); + //negativeTestCases.Append("\""+folderPath+"\""); + sb.Append(":"); + string s = GetSerializedSputnikTestScript(new SputnikTestScript() + { + Description = script.Description, + Assertion = script.Assertion, + }); + sb.Append(s.Substring(0, s.LastIndexOf('}')) + ",\"negative\":\"syntax\"}"); + + if (negativeTestCases == null) + negativeTestCases = new StringBuilder(); + else + negativeTestCases.Append(","); + negativeTestCases.Append(sb.ToString()); + } + Logger.WriteToLog(destFullPath); } catch (ArgumentException ex) @@ -106,6 +144,55 @@ namespace Microsoft.Sputnik.Interop.ParserEngine // } } + /// <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. + //FileStream fs = new FileStream("c:\\ecmascript\\GlobalScope.js", FileMode.Create, FileAccess.Write); + if (!Directory.Exists(destination)) + { + Directory.CreateDirectory(destination); + } + FileStream fs = new FileStream(destination + "\\GlobalScope.js", FileMode.Create, FileAccess.Write); + StreamWriter sw = new StreamWriter(fs); + sw.Write("var GlobalScopeTests ="); + sw.Flush(); + sw.Close(); + fs.Close(); + //negativeTestCases = new StringBuilder(); + } + + /// <summary> + /// Method to update the GlobalScope.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. + //negativeTestCases.Replace(",", "};", negativeTestCases.Length - 2, 2); + //negativeTestCases.Append(";"); + //File.AppendAllText("c:\\temp\\GlobalScope.js", "{"+negativeTestCases.ToString()+"};"); + File.AppendAllText(destination +"\\GlobalScope.js", "{" + 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); @@ -161,5 +248,25 @@ namespace Microsoft.Sputnik.Interop.ParserEngine string inputTemplatePath = ConfigurationManager.AppSettings[configSetting].ToString(); return (new StreamReader(inputTemplatePath)).ReadToEnd(); } + + private static string GetPartialPath(string fullPath, int levelsRequired) + { + string remainingString = fullPath; + string[] partialPaths = new string[levelsRequired]; + string finalPath = "GlobalScope"; + + for (int iterator = 0; iterator < levelsRequired; iterator++) + { + partialPaths[iterator] = remainingString.Substring(remainingString.LastIndexOf(@"\")); + remainingString = remainingString.Substring(0, remainingString.LastIndexOf(@"\")); + } + + for (int iterator = partialPaths.Length - 1; iterator >= 0; iterator--) + { + finalPath += partialPaths[iterator]; + } + //finalPath = finalPath.Replace(@"\/", "/"); + return finalPath; + } } } diff --git a/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj b/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj index 938abf1223708ca8754f29f1b3a04061d6dddb71..1c411f47aaf7ef0e99da3436aa298f50d6d44732 100644 --- a/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj +++ b/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj @@ -55,6 +55,7 @@ <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" /> @@ -101,6 +102,7 @@ <EmbeddedResource Include="ResourceClass.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>ResourceClass.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> @@ -125,6 +127,10 @@ <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. diff --git a/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj.user b/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj.user index ef3320843cd27beea0b20d56cb76694aea66ad06..18af890b4ba68d2452b9dd461792ae48f70d5bcd 100644 --- a/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj.user +++ b/tools/SputnikConverter/Microsoft.Sputnik.Interop.ParserEngine.csproj.user @@ -12,7 +12,8 @@ <VerifyUploadedFiles>false</VerifyUploadedFiles> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> - <StartWorkingDirectory>C:\Users\allenwb\Desktop\cvt262\prog\prog</StartWorkingDirectory> - <StartArguments>C:\Users\allenwb\Desktop\cvt262\sput9-8-2010\tests C:\Users\allenwb\Desktop\cvt262\result</StartArguments> + <StartWorkingDirectory> + </StartWorkingDirectory> + <StartArguments>E:\test262-msft\test\suite\sputnik\conformance E:\test262-msft\test\suite\sputnik_new01</StartArguments> </PropertyGroup> </Project> \ No newline at end of file diff --git a/tools/SputnikConverter/Program.cs b/tools/SputnikConverter/Program.cs index 1d5b68d614dd80bc7d5cf0184b25dbb3a823bdbe..626056d241911d1973a49960f503baaf7f953384 100644 --- a/tools/SputnikConverter/Program.cs +++ b/tools/SputnikConverter/Program.cs @@ -20,7 +20,7 @@ namespace Microsoft.Sputnik.Interop.ParserEngine source = args[0]; destination = args[1]; - string root = "Conformance"; + string root = "conformance"; int countInputFiles = 0; try @@ -30,14 +30,17 @@ namespace Microsoft.Sputnik.Interop.ParserEngine 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); - ES5TestScript.Save(testScript, root, destination); + testScript.Load(filePath); + 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()); diff --git a/tools/SputnikConverter/ResourceClass.Designer.cs b/tools/SputnikConverter/ResourceClass.Designer.cs index 03fe932b0c20fe1a3203070bea398495dc4e76ef..a50920e9df54407e7125ad361fa59c21302ac09b 100644 --- a/tools/SputnikConverter/ResourceClass.Designer.cs +++ b/tools/SputnikConverter/ResourceClass.Designer.cs @@ -159,6 +159,15 @@ namespace Microsoft.Sputnik.Interop.ParserEngine { } } + /// <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> diff --git a/tools/SputnikConverter/ResourceClass.resx b/tools/SputnikConverter/ResourceClass.resx index 00260cd047ef56c9d7f663fcf4428870cb567c14..f9d75254323f152689557d1585590e59d23fbe04 100644 --- a/tools/SputnikConverter/ResourceClass.resx +++ b/tools/SputnikConverter/ResourceClass.resx @@ -189,4 +189,7 @@ <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> \ No newline at end of file diff --git a/tools/SputnikConverter/SputnikTestCase.cs b/tools/SputnikConverter/SputnikTestCase.cs index 7f8d41d88af79a0d73dcf8114356e6e91e1a3bb7..680a681328c5cd0591248b67efce46ac7cdcf49e 100644 --- a/tools/SputnikConverter/SputnikTestCase.cs +++ b/tools/SputnikConverter/SputnikTestCase.cs @@ -7,14 +7,17 @@ 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; private bool negativeTest = false; @@ -26,11 +29,12 @@ namespace Microsoft.Sputnik.Interop.ParserEngine public string Header = string.Empty; public string Body = string.Empty; + public string InitialComment = string.Empty; /// <summary> /// Gets or sets the ID. /// </summary> - /// <value>The ID.</value> + /// <value>The ID.</value> public string Id { get @@ -102,9 +106,12 @@ namespace Microsoft.Sputnik.Interop.ParserEngine actualFileConvertedCount = value; } } + + /// <summary> /// Gets or sets the testScriptDescription /// </summary> + [DataMember] public string Description { get @@ -118,6 +125,23 @@ namespace Microsoft.Sputnik.Interop.ParserEngine } } + /// <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> @@ -271,6 +295,11 @@ namespace Microsoft.Sputnik.Interop.ParserEngine 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 = ConfigurationManager.AppSettings[ResourceClass.CommentsRegexSettingKey].ToString(); @@ -290,11 +319,15 @@ namespace Microsoft.Sputnik.Interop.ParserEngine string commentKey = arrComments[0].ToLower(); if (commentKey.Contains(ResourceClass.LookFor_Name)) { - this.Id = arrComments[arrComments.Length - 1].Trim(trimDelimit); + this.Id = GetRealId(arrComments[arrComments.Length - 1].Trim(trimDelimit)); } if (commentKey.Contains(ResourceClass.LookFor_Section)) { - this.SectionName = arrComments[arrComments.Length - 1].Trim(trimDelimit); + this.SectionName = GetRealSectionName(arrComments[arrComments.Length - 1].Trim(trimDelimit)); + } + if (commentKey.Contains(ResourceClass.LookFor_Assertion)) + { + this.Assertion = arrComments[arrComments.Length - 1].Trim(trimDelimit); } if (commentKey.Contains(ResourceClass.LookFor_Description)) { @@ -340,16 +373,17 @@ namespace Microsoft.Sputnik.Interop.ParserEngine if (arrComments[0].Contains(ResourceClass.LookFor_Name)) { - this.Id = arrComments[arrComments.Length - 1]; + this.Id = GetRealId(arrComments[arrComments.Length - 1]); } if (arrComments[0].Contains(ResourceClass.LookFor_Section)) { - this.SectionName = arrComments[arrComments.Length - 1]; + this.SectionName = GetRealSectionName(arrComments[arrComments.Length - 1]); } if (arrComments[0].Contains(ResourceClass.LookFor_Description)) { this.Description = arrComments[arrComments.Length - 1]; } + } //string holdGlobalCode = matchGlobalCode.Value; @@ -362,6 +396,20 @@ namespace Microsoft.Sputnik.Interop.ParserEngine this.PossibleChecksCount = checks.Count; } + private static string GetRealId(string id) + { + Regex regx = new Regex("^ S([0-9]+)_"); + return regx.Replace(id, " S$1.0_", 1); + } + private static string GetRealSectionName(string sectionName) + { + //Regex regx = new Regex("/S([0-9]+)_([^/]+)$"); + Regex regx = new Regex("^ ([0-9]+)$"); + if (! regx.IsMatch(sectionName)) { + return sectionName; + } + return regx.Replace(sectionName, " $1.0", 1); + } } } diff --git a/tools/SputnikConverter/bin/Debug/InputFormats.xml b/tools/SputnikConverter/bin/Debug/InputFormats.xml new file mode 100644 index 0000000000000000000000000000000000000000..840952f2f4fa735dcf45c852b21dff0dc82eb2c5 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/InputFormats.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" ?> +<formats> + <format id="1" sequence="1">\s*CHECK#[0-9]\r\n(.*(\r\n)?.)+</format> +</formats> diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.exe b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.exe new file mode 100644 index 0000000000000000000000000000000000000000..128931c0c59bf04bf4a23e71f95ebf7d38b6511a Binary files /dev/null and b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.exe differ diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.exe.config b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.exe.config new file mode 100644 index 0000000000000000000000000000000000000000..7551afef46e626f3077fdc813c36ebdd63f44de4 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.exe.config @@ -0,0 +1,14 @@ +<?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> \ No newline at end of file diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.pdb b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.pdb new file mode 100644 index 0000000000000000000000000000000000000000..baa98d0464aa0ae7426ec893fa8e3b5e8e752e7d Binary files /dev/null and b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.pdb differ diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.suo b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.suo new file mode 100644 index 0000000000000000000000000000000000000000..8e0744da4bc7a159b817aa866f48709e114da84b Binary files /dev/null and b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.suo differ diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe new file mode 100644 index 0000000000000000000000000000000000000000..bb84a51ac4f20534146c09f2fd9c928d15a903b2 Binary files /dev/null and b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe differ diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe.config b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe.config new file mode 100644 index 0000000000000000000000000000000000000000..7551afef46e626f3077fdc813c36ebdd63f44de4 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe.config @@ -0,0 +1,14 @@ +<?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> \ No newline at end of file diff --git a/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe.manifest b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe.manifest new file mode 100644 index 0000000000000000000000000000000000000000..f96b1d6b3fa078c224681c663f485501b44f10c1 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/Microsoft.Sputnik.Interop.ParserEngine.vshost.exe.manifest @@ -0,0 +1,11 @@ +<?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> diff --git a/tools/SputnikConverter/bin/Debug/testNegativePrereqTemplate.js b/tools/SputnikConverter/bin/Debug/testNegativePrereqTemplate.js new file mode 100644 index 0000000000000000000000000000000000000000..1a59a840368c146bccdb4ae241429e3c0b6a6271 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/testNegativePrereqTemplate.js @@ -0,0 +1,22 @@ +{0} +// Converted for Test262 from original Sputnik source + +ES5Harness.registerTest( {{ +id: "{1}", + +path: "{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} + }} +}}); diff --git a/tools/SputnikConverter/bin/Debug/testNegativeTemplate.js b/tools/SputnikConverter/bin/Debug/testNegativeTemplate.js new file mode 100644 index 0000000000000000000000000000000000000000..e9b503ebf694f39c1b1d51c714105a861e2603b7 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/testNegativeTemplate.js @@ -0,0 +1,4 @@ +{8} +// Converted for Test262 from original Sputnik source + +{5} {6} diff --git a/tools/SputnikConverter/bin/Debug/testPrereqTemplate.js b/tools/SputnikConverter/bin/Debug/testPrereqTemplate.js new file mode 100644 index 0000000000000000000000000000000000000000..62f170bf3661a77d90104b2a1d82827d5c9f8e81 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/testPrereqTemplate.js @@ -0,0 +1,21 @@ +{0} +// Converted for Test262 from original Sputnik source + +ES5Harness.registerTest( {{ +id: "{1}", + +path: "{2}", + +assertion: "{3}", + +description: "{4}", + +test: function testcase() {{ + {5} {6} + }}, + +precondition: function precond() {{ + {7} + }} + +}}); diff --git a/tools/SputnikConverter/bin/Debug/testTemplate.js b/tools/SputnikConverter/bin/Debug/testTemplate.js new file mode 100644 index 0000000000000000000000000000000000000000..e79eff4e302f2f017aa93f709dd7be7d38b94625 --- /dev/null +++ b/tools/SputnikConverter/bin/Debug/testTemplate.js @@ -0,0 +1,16 @@ +{0} +// Converted for Test262 from original Sputnik source + +ES5Harness.registerTest( {{ +id: "{1}", + +path: "{2}", + +assertion: "{3}", + +description: "{4}", + +test: function testcase() {{ + {5} {6} + }} +}}); diff --git a/tools/SputnikConverter/testNegativePrereqTemplate.js b/tools/SputnikConverter/testNegativePrereqTemplate.js index 02e62f3d795aa91351d95595981af3b3145c5d0e..1a59a840368c146bccdb4ae241429e3c0b6a6271 100644 --- a/tools/SputnikConverter/testNegativePrereqTemplate.js +++ b/tools/SputnikConverter/testNegativePrereqTemplate.js @@ -6,17 +6,17 @@ id: "{1}", path: "{2}", -description: "{3}", +description: "{4}", test: function testcase() {{ try {{ (function() {{ - {4} {5} }})(); + {5} {6} }})(); }} catch (__e__) {{return true /* failure is success */}}; return false /* but success is failure */ }}, precondition: function precond() {{ - {6} + {7} }} }}); diff --git a/tools/SputnikConverter/testNegativeTemplate.js b/tools/SputnikConverter/testNegativeTemplate.js index 0ca6abbb9c683fa33bf06934f607df1f06ae96ca..e9b503ebf694f39c1b1d51c714105a861e2603b7 100644 --- a/tools/SputnikConverter/testNegativeTemplate.js +++ b/tools/SputnikConverter/testNegativeTemplate.js @@ -1,18 +1,4 @@ -{0} +{8} // Converted for Test262 from original Sputnik source -ES5Harness.registerTest( {{ -id: "{1}", - -path: "{2}", - -description: "{3}", - -test: function testcase() {{ - try {{ - (function() {{ - {4} {5} }})(); - }} catch (__e__) {{return true /* failure is success */}}; - return false /* but success is failure */ - }} -}}); +{5} {6} diff --git a/tools/SputnikConverter/testPrereqTemplate.js b/tools/SputnikConverter/testPrereqTemplate.js index 432c60e1ad45dee9b5e5f2378a0cd574c6e4ba56..62f170bf3661a77d90104b2a1d82827d5c9f8e81 100644 --- a/tools/SputnikConverter/testPrereqTemplate.js +++ b/tools/SputnikConverter/testPrereqTemplate.js @@ -6,14 +6,16 @@ id: "{1}", path: "{2}", -description: "{3}", +assertion: "{3}", + +description: "{4}", test: function testcase() {{ - {4} {5} + {5} {6} }}, precondition: function precond() {{ - {6} + {7} }} }}); diff --git a/tools/SputnikConverter/testTemplate.js b/tools/SputnikConverter/testTemplate.js index 62a7a2739212b99b37c371821506b1f562dfd86c..e79eff4e302f2f017aa93f709dd7be7d38b94625 100644 --- a/tools/SputnikConverter/testTemplate.js +++ b/tools/SputnikConverter/testTemplate.js @@ -6,9 +6,11 @@ id: "{1}", path: "{2}", -description: "{3}", +assertion: "{3}", + +description: "{4}", test: function testcase() {{ - {4} {5} + {5} {6} }} }});