Пример #1
0
 internal Row(DataRowBuilder rb)
     : base(rb)
 {
     this.table = ((TESTCASE_FUNC)(this.Table));
 }
Пример #2
0
    public bool update_func_mappings(string user_id, string filename)
    {
        string testcase = string.Empty;
        string line     = string.Empty;

        StreamReader stream = new StreamReader(filename);

        try
        {
            TESTCASE_FUNC test_func = new TESTCASE_FUNC();
            TESTCASE      tcases    = new TESTCASE();
            while (null != (line = stream.ReadLine()))
            {
                MatchCollection matches;
                if (string.Empty == testcase)
                {
                    // "Profiled target:  ./pdls -s -e pdf /m/tcases/futures/next/wip/pdf/fonts/report.pdf (PID 23196, part 1)"
                    matches = Regex.Matches(line, "Profiled target:.*-e\\s*(?<emul>[^\\s]+)\\s*(?<testcase>[^\\s]+)", RegexOptions.IgnoreCase);
                    foreach (Match match in matches)
                    {
                        TESTCASE.Row t = tcases.NewRow();
                        t.TLOC   = match.Groups["testcase"].Value;
                        t.TTYPE  = match.Groups["emul"].Value.ToUpper();
                        t.TNAME  = t.TLOC.Substring(t.TLOC.LastIndexOf('/') + 1);
                        t.HIDDEN = 'N';
                        tcases.merge(t);
                        t        = tcases.lookup(t);
                        testcase = t.TGUID;
                    }
                }
                else
                {
                    // /usr/src/debug/graphen/0.0+gitAUTOINC+a8befc5ef3-r0/git/xi/fonts.c:AddName
                    matches = Regex.Matches(line, "\\s*(?<path>/.*)/(?<file>.*):(?<func>\\w+)", RegexOptions.IgnoreCase);
                    foreach (Match match in matches)
                    {
                        try
                        {
                            FUNC.Row func = NewRow();
                            string   file = string.Format("{0}/{1}", match.Groups["path"].Value, match.Groups["file"].Value);
                            string   name = match.Groups["func"].Value;

                            func.SOURCE_FILE = file;
                            func.FUNC_NAME   = name;
                            func.LINE_NO     = 0;
                            func.FID         = lookup_fid(func);

                            Console.WriteLine("{0} ==> {1}", func.SOURCE_FILE, func.FUNC_NAME);

                            merge(func);

                            test_func.update(testcase, func);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(testcase + " ERROR: " + e.StackTrace);
                            throw e;
                        }
                        break;
                    }
                }
            }

            return(true);
        }
        finally
        {
            stream.Close();
        }
    }