David Fugate 24b2fcf78d Vendor did a bit of work to preserve Sputnik's negative test cases in their existing format.
Still needs a bit of integration work into the test harness.

A number of Sputnik tests were written outside the context of a chapter's sections.  E.g.,
"Chapter 13" versus "Chapter 13, Section 1".  We now fake a section number ("13.0" for the
example above) for such cases when generating test case metadata.
2011-04-08 13:29:16 -07:00

61 lines
2.1 KiB
C#

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)
{
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);
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();
}
}
}
}