2 using System.Collections;
7 namespace MonoTests.oasis_xslt {
8 public class Generator: IDisposable
10 #region test list fields
11 ArrayList skipTargets = new ArrayList ();
12 StreamWriter resultExceptionsWriter;
15 #region IDisposable Members
18 if (resultExceptionsWriter!=null)
19 resultExceptionsWriter.Close ();
20 resultExceptionsWriter = null;
25 public static int Main (string [] args) {
26 using (Generator test = new Generator (args)) {
34 Generator (string [] args)
41 string resultExceptionsFilename = Path.Combine (EnvOptions.OutputDir, "res-exceptions.lst");
43 if (Directory.Exists (EnvOptions.OutputDir))
44 Directory.Delete (EnvOptions.OutputDir, true);
45 Directory.CreateDirectory (EnvOptions.OutputDir);
47 Helpers.ReadStrings (skipTargets, "ignore.lst");
49 resultExceptionsWriter = new StreamWriter (resultExceptionsFilename);
51 XmlDocument catalog = new XmlDocument ();
52 catalog.Load (@"testsuite/TESTS/catalog-fixed.xml");
54 foreach (XmlElement testCase in catalog.SelectNodes ("test-suite/test-catalog/test-case")) {
55 ProcessTestCase (testCase);
59 void ProcessTestCase (XmlElement testCase) {
60 string testid = testCase.GetAttribute ("id");
61 Console.Out.WriteLine (testid);
62 if (skipTargets.Contains (testid))
65 CatalogTestCase ctc = new CatalogTestCase(EnvOptions.OutputDir, testCase);
69 SingleTestTransform stt = new SingleTestTransform (ctc);
72 using (StreamWriter fw = new StreamWriter (ctc.OutFile, false, Encoding.UTF8))
73 fw.Write (stt.Result);
75 resultExceptionsWriter.WriteLine ("{0}\t{1}", testid, stt.Exception.GetType ().ToString ());