Exemplo n.º 1
0
        public void Build()
        {
//			if (Environment.GetEnvironmentVariables().Contains("START_DEBUG"))
//				System.Diagnostics.Debugger.Launch ();
            ReadLists();
            XmlDocument whole = new XmlDocument();

            whole.Load(@"testsuite/TESTS/catalog-fixed.xml");

            foreach (XmlElement testCase in whole.SelectNodes("test-suite/test-catalog/test-case"))
            {
                string testid = testCase.GetAttribute("id");

                if (skipTargets.Contains(testid))
                {
                    continue;
                }

                CatalogTestCase ctc = new CatalogTestCase(EnvOptions.OutputDir, testCase);
                if (!ctc.Process())
                {
                    continue;
                }

                SingleTestTransform stt = new SingleTestTransform(ctc);

                string expectedException = (string)expectedExceptions[testid];
                bool   isKnownFailure    = knownFailures.Contains(testid) || fixmeList.Contains(testid);

                _suite.Add(new TestFromCatalog(testid, stt, expectedException,
                                               EnvOptions.InverseResults, isKnownFailure));
            }
        }
Exemplo n.º 2
0
		void Build (TestSuite suite)
		{
//			if (Environment.GetEnvironmentVariables().Contains("START_DEBUG"))
//				System.Diagnostics.Debugger.Launch ();
			ReadLists ();
			XmlDocument whole = new XmlDocument ();
			whole.Load (@"testsuite/TESTS/catalog-fixed.xml");

			foreach (XmlElement testCase in whole.SelectNodes ("test-suite/test-catalog/test-case")) {
				string testid = testCase.GetAttribute ("id");

				if (skipTargets.Contains (testid))
					continue;

				CatalogTestCase ctc = new CatalogTestCase(EnvOptions.OutputDir, testCase);
				if (!ctc.Process ())
					continue;

				SingleTestTransform stt = new SingleTestTransform (ctc);

				string expectedException = (string) expectedExceptions[testid];
				bool isKnownFailure = knownFailures.Contains (testid) || fixmeList.Contains (testid);

				suite.Add (new TestFromCatalog (testid, stt, expectedException,
					EnvOptions.InverseResults, isKnownFailure));
			}
		}
Exemplo n.º 3
0
        void ProcessTestCase(XmlElement testCase)
        {
            string testid = testCase.GetAttribute("id");

            Console.Out.WriteLine(testid);
            if (skipTargets.Contains(testid))
            {
                return;
            }

            CatalogTestCase ctc = new CatalogTestCase(EnvOptions.OutputDir, testCase);

            if (!ctc.Process())
            {
                return;
            }

            SingleTestTransform stt = new SingleTestTransform(ctc);

            stt.RunTest();
            if (stt.Succeeded)
            {
                using (StreamWriter fw = new StreamWriter(ctc.OutFile, false, Encoding.UTF8))
                    fw.Write(stt.Result);
            }
            else
            {
                resultExceptionsWriter.WriteLine("{0}\t{1}", testid, stt.Exception.GetType().ToString());
            }
        }
Exemplo n.º 4
0
		void ProcessTestCase (XmlElement testCase) {
			string testid = testCase.GetAttribute ("id");
			Console.Out.WriteLine (testid);
			if (skipTargets.Contains (testid))
				return;

			CatalogTestCase ctc = new CatalogTestCase(EnvOptions.OutputDir, testCase);
			if (!ctc.Process ())
				return;

			SingleTestTransform stt = new SingleTestTransform (ctc);
			stt.RunTest ();
			if (stt.Succeeded)
				using (StreamWriter fw = new StreamWriter (ctc.OutFile, false, Encoding.UTF8))
					fw.Write (stt.Result);
			else
				resultExceptionsWriter.WriteLine ("{0}\t{1}", testid, stt.Exception.GetType ().ToString ());
		}
Exemplo n.º 5
0
		string CompareResult (string actual, string expected, CatalogTestCase.CompareType compare)
		{
			//TODO: add html comparison
			if (compare== CatalogTestCase.CompareType.XML) {
				try {
					XmlDocument actDoc = new XmlDocument();
					XmlDocument expDoc = new XmlDocument();
					actDoc.LoadXml (actual);
					expDoc.LoadXml (expected);
					XmlCompare.XmlCompare cmp = new XmlCompare.XmlCompare(XmlCompare.XmlCompare.Flags.IgnoreAttribOrder);
					if (cmp.AreEqual (actDoc, expDoc)) {
						return null;
					}
				}
				catch (Exception ex) {
					//could not compare as xml, fallback to text
					if (actual == expected)
						return null;
				}
			}
			else
				if (actual == expected)
					return null;

			string res = "Different.\nActual*****\n"+actual+"\nReference*****\n"+expected;
			return EscapeString (res);
		}
Exemplo n.º 6
0
 public SingleTestTransform(CatalogTestCase testCase)
 {
     _testCase = testCase;
 }
Exemplo n.º 7
0
		public SingleTestTransform (CatalogTestCase testCase)
		{
			_testCase = testCase;
		}