コード例 #1
0
        public void TestAnalyzeStubPackage()
        {
            var pkg = m_packageGenerator.AnalyzePackageStub(s_packagesOnConfig);

            XAssert.IsFalse(pkg.IsManagedPackage);
            XAssert.IsEmpty(pkg.Dependencies);
            XAssert.IsEmpty(pkg.DependenciesPerFramework);
            XAssert.IsEmpty(pkg.Libraries);
            XAssert.IsEmpty(pkg.References);
            XAssert.SetEqual(m_monikers.WellknownMonikers, pkg.TargetFrameworks);
        }
コード例 #2
0
        public void ValidateSharedCompilationAccessesAgainstNonSharedCompilation()
        {
            // Run the same managed csc call with and without shared compilation
            var sharedAccessCollector    = RunManagedCompilation(useSharedCompilation: true, absolutePathToReference: out _, usedTempDirectory: out _);
            var nonSharedAccessCollector = RunManagedCompilation(useSharedCompilation: false, absolutePathToReference: out _, usedTempDirectory: out var tempDirectory);

            // The non-shared accesses should be a subset of the shared ones. Shared access case could be over-reporting since
            // some predicted artifacts may not be accessed at all. This is anyway a conservative check.
            // Observe there might be some differences under the temp directory, since MSBuild generates there some files with random names, so they are different on each execution. We exclude those.
            var diff = nonSharedAccessCollector.GetFileAccessPaths()
                       .Except(sharedAccessCollector.GetFileAccessPaths())
                       .Where(path => !path.IsWithin(PathTable, tempDirectory));

            // There shouldn't be non shared accesses that were not predicted
            XAssert.IsEmpty(diff);
        }