Esempio n. 1
0
        public void NETStandardTargetingPackIsValid()
        {
            using (var tester = NuGetArtifactTester.OpenOrNull(
                       dirs,
                       "NETStandard.Library.Ref"))
            {
                // Allow no targeting pack in case this is a servicing build.
                // This condition should be tightened: https://github.com/dotnet/core-setup/issues/8830
                if (tester == null)
                {
                    return;
                }

                tester.HasOnlyTheseDataFiles(
                    "data/FrameworkList.xml",
                    "data/PackageOverrides.txt");

                tester.IsTargetingPack();

                // Most artifacts in the repo use the global Major.Minor, this package doesn't. Test
                // this to make sure infra doesn't regress and cause netstandard to lose its special
                // 2.1 version. The versioning difference is because netstandard targeting pack
                // creation doesn't actually belong in Core-Setup: https://github.com/dotnet/standard/issues/1209
                Assert.Equal(
                    (2, 1),
                    (tester.PackageVersion.Major, tester.PackageVersion.Minor));
            }
        }
        public void WindowsDesktopTargetingPackIsValid()
        {
            // Use "OrNull" variant to get null if this nupkg doesn't exist. WindowsDesktop is only
            // built on officially supported platforms.
            using (var tester = NuGetArtifactTester.OpenOrNull(
                       dirs,
                       "Microsoft.WindowsDesktop.App.Ref"))
            {
                if (CurrentRidShouldCreateNupkg)
                {
                    // Allow no targeting pack in case this is a servicing build.
                    // This condition should be tightened: https://github.com/dotnet/core-setup/issues/8830
                    if (tester == null)
                    {
                        return;
                    }

                    tester.IsTargetingPackForPlatform();
                    tester.HasOnlyTheseDataFiles(
                        "data/FrameworkList.xml",
                        "data/PlatformManifest.txt");
                }
                else
                {
                    Assert.Null(tester);
                }
            }
        }
Esempio n. 3
0
 public void NETCoreRuntimePackIsValid()
 {
     using (var tester = NuGetArtifactTester.Open(
                dirs,
                "Microsoft.NETCore.App.Runtime",
                $"Microsoft.NETCore.App.Runtime.{dirs.BuildRID}"))
     {
         tester.IsRuntimePack();
     }
 }
Esempio n. 4
0
 public void NETCoreAppHostPackIsValid()
 {
     using (var tester = NuGetArtifactTester.Open(
                dirs,
                "Microsoft.NETCore.App.Host",
                $"Microsoft.NETCore.App.Host.{dirs.BuildRID}"))
     {
         tester.IsAppHostPack();
     }
 }
Esempio n. 5
0
 public void NETCoreTargetingPackIsValid()
 {
     using (var tester = NuGetArtifactTester.Open(
                dirs,
                "Microsoft.NETCore.App.Ref"))
     {
         tester.IsTargetingPackForPlatform();
         tester.HasOnlyTheseDataFiles(
             "data/FrameworkList.xml",
             "data/PackageOverrides.txt",
             "data/PlatformManifest.txt");
     }
 }
Esempio n. 6
0
        public void WindowsDesktopRuntimePackIsValid()
        {
            using (var tester = NuGetArtifactTester.OpenOrNull(
                       dirs,
                       "Microsoft.WindowsDesktop.App.Runtime",
                       $"Microsoft.WindowsDesktop.App.Runtime.{dirs.BuildRID}"))
            {
                if (CurrentRidShouldCreateNupkg)
                {
                    Assert.NotNull(tester);

                    tester.IsRuntimePack();
                }
                else
                {
                    Assert.Null(tester);
                }
            }
        }
Esempio n. 7
0
        public void NETCoreTargetingPackIsValid()
        {
            using (var tester = NuGetArtifactTester.OpenOrNull(
                       dirs,
                       "Microsoft.NETCore.App.Ref"))
            {
                // Allow no targeting pack in case this is a servicing build.
                // This condition should be tightened: https://github.com/dotnet/core-setup/issues/8830
                if (tester == null)
                {
                    return;
                }

                tester.IsTargetingPackForPlatform();
                tester.HasOnlyTheseDataFiles(
                    "data/FrameworkList.xml",
                    "data/PackageOverrides.txt",
                    "data/PlatformManifest.txt");
            }
        }
Esempio n. 8
0
        public void WindowsDesktopTargetingPackIsValid()
        {
            // Use "OrNull" variant to get null if this nupkg doesn't exist. WindowsDesktop is only
            // built on officially supported platforms.
            using (var tester = NuGetArtifactTester.OpenOrNull(
                       dirs,
                       "Microsoft.WindowsDesktop.App.Ref"))
            {
                if (CurrentRidShouldCreateNupkg)
                {
                    Assert.NotNull(tester);

                    tester.IsTargetingPackForPlatform();
                    tester.HasOnlyTheseDataFiles(
                        "data/FrameworkList.xml",
                        "data/PlatformManifest.txt");
                }
                else
                {
                    Assert.Null(tester);
                }
            }
        }
Esempio n. 9
0
        public void WindowsDesktopFrameworkListHasClassifications()
        {
            using (var tester = NuGetArtifactTester.OpenOrNull(
                       dirs,
                       "Microsoft.WindowsDesktop.App.Ref"))
            {
                // Let other test case handle if this is OK.
                if (tester == null)
                {
                    return;
                }

                XDocument fxList = tester.ReadEntryXDocument("data/FrameworkList.xml");
                var       files  = fxList.Element("FileList").Elements("File").ToArray();

                // Sanity check: did any elements we expect make it into the final file?
                foreach (var attributeName in new[] { "Profile" })
                {
                    Assert.True(
                        files.Any(x => !string.IsNullOrEmpty(x.Attribute(attributeName)?.Value)),
                        $"Can't find a non-empty '{attributeName}' attribute in framework list.");
                }
            }
        }