Exemple #1
0
 public CoverageFile(string fileName, string?realName, InstrumentedFile file)
 {
     FileName         = fileName;
     RealName         = realName;
     InstrumentedFile = file;
     Name             = PathUtils.Name(fileName);
     Important        = file.Important;
     Infos            = new StructList <CoverageInfo>();
     Infos.Reserve(file.Infos.Count);
     foreach (var info in file.Infos)
     {
         Infos.Add(new CoverageInfo(info));
     }
 }
Exemple #2
0
        internal InstrumentedFile GetForFile(string name)
        {
            if (!InstrumentedFiles.TryGetValue(name, out var res))
            {
                string?real = null;
                if (RealPath != null)
                {
                    real = RealPath.Invoke(name);
                    if (real == name)
                    {
                        real = null;
                    }
                }

                res = new InstrumentedFile(name, real);
                InstrumentedFiles.Add(name, res);
                if (real != null)
                {
                    InstrumentedFiles[real] = res;
                }
            }

            return(res);
        }