Exemplo n.º 1
0
        private static IEnumerable <(string docId, ExceptionInfo result)> GetResults(IAssembly assembly)
        {
            var results  = new List <(string docId, ExceptionInfo result)>();
            var reporter = new DelegatedExceptionReporter((r, m) =>
            {
                if (r.Throws)
                {
                    results.Add((m.DocId(), r));
                }
            });
            var scanner = new ExceptionScanner(reporter);

            scanner.ScanAssembly(assembly);
            return(results);
        }
Exemplo n.º 2
0
        private static void Run(string inputPath, string outputPath)
        {
            var assemblies = LoadAssemblies(inputPath);

            using (var textWriter = new StreamWriter(outputPath))
            {
                var csvWriter = new CsvWriter(textWriter);
                var reporter  = new CsvReporter(csvWriter);
                var scanner   = new ExceptionScanner(reporter);

                foreach (var assembly in assemblies)
                {
                    scanner.ScanAssembly(assembly);
                }
            }
        }
Exemplo n.º 3
0
        private static (Database raw, Database filtered) Scan(string sourcePath, string inclusionFile, string exclusionFile)
        {
            Console.WriteLine("Analyzing...");

            var platforms     = EnumeratePlatformDirectories(sourcePath);
            var platformNames = platforms.Select(e => e.platform).ToList();

            Database exclusionDatabase = null;

            if (exclusionFile != null)
            {
                exclusionDatabase = new Database();
                ImportCsv(exclusionFile, platformNames, exclusionDatabase);
            }

            var filtered = new Database(exclusionDatabase);

            if (inclusionFile != null)
            {
                ImportCsv(inclusionFile, platformNames, filtered);
            }

            var raw = new Database();

            foreach (var entry in platforms)
            {
                Console.WriteLine("\t" + entry.platform);

                var platform  = entry.platform;
                var directory = entry.directory;
                var reporter  = new DatabaseReporter(new[] { raw, filtered }, platform);

                var analyzer   = new ExceptionScanner(reporter);
                var assemblies = HostEnvironment.LoadAssemblySet(directory);

                foreach (var assembly in assemblies)
                {
                    analyzer.ScanAssembly(assembly);
                }
            }

            return(raw, filtered);
        }