示例#1
0
        public static void TraceHtmlReader_v3(string file, bool generateCloseTag = false, bool disableLineColumn = false)
        {
            string traceFile = GetFile(file, ".trace.v3.txt");

            Trace.WriteLine("HtmlReader v3");
            Trace.WriteLine("  file  \"{0}\"", file);
            Trace.WriteLine("  trace \"{0}\"", traceFile);
            //HtmlReader_v3.GenerateCloseTag = false;
            //HtmlReader_v3.DisableLineColumn = true;
            HtmlReader_v3.ReadFile(file, generateCloseTag: generateCloseTag, disableLineColumn: disableLineColumn).zSave(traceFile);
        }
示例#2
0
        public static void Test_HtmlReader_v2_v3(string directory = null)
        {
            // compare HtmlReader_v2 and HtmlReader_v3
            // for each html file :
            //   - generate HtmlReader_v2 trace file .html.trace.v2.txt
            //   - generate HtmlReader_v3 trace file .html.trace.v3.txt
            //   - compare .html.trace.v2.txt with .html.trace.v3.txt

            int nb           = 0;
            int okTraceNb    = 0;
            int notOkTraceNb = 0;

            foreach (string file in GetHtmlFiles(directory))
            {
                nb++;
                Trace.WriteLine("file \"{0}\"", file);

                //string xmlFile = GetXmlFile(file);
                string traceFile_v2 = GetFile(file, ".trace.v2.txt");
                //FileHtmlToXml_v2(file, xmlFile, traceFile_v2);
                TraceHtmlReader_v2(file, traceFile_v2);

                string traceFile_v3 = GetFile(file, ".trace.v3.txt");
                HtmlReader_v3.ReadFile(file, generateCloseTag: false, disableLineColumn: true).zSave(traceFile_v3);
                if (zfile.AreFileEqual(traceFile_v2, traceFile_v3))
                {
                    okTraceNb++;
                    Trace.WriteLine("  trace files ok");
                }
                else
                {
                    notOkTraceNb++;
                    Trace.WriteLine("  trace files not identical");
                }
            }
            Trace.WriteLine();
            Trace.WriteLine("{0} files", nb);
            Trace.WriteLine("trace files : ok {0}, not ok {1}", okTraceNb, notOkTraceNb);
        }