Exemple #1
0
        private bool VersionMatches(TestDescriptor test, Version runtimeVersion)
        {
            if (test.VersionSpecific)
            {
                if ((runtimeVersion.Major + ".x").Equals(test.Version, StringComparison.Ordinal))
                {
                    return(true);
                }
                else if (runtimeVersion.MajorMinor.Equals(test.Version, StringComparison.Ordinal))
                {
                    return(true);
                }

                return(false);
            }
            else
            {
                var testVersion = Version.Parse(test.Version);
                if (runtimeVersion >= testVersion)
                {
                    return(true);
                }

                return(false);
            }
        }
Exemple #2
0
        public bool ShouldRunTest(SystemUnderTest system, TestDescriptor test)
        {
            if (!test.Enabled)
            {
                return(false);
            }

            if (!VersionMatches(test, system.RuntimeVersion))
            {
                return(false);
            }

            if (system.SdkVersion == null && test.RequiresSdk)
            {
                return(false);
            }

            var skipped = system.CurrentPlatformIds
                          .Where(rid => test.IgnoredRIDs.Contains(rid))
                          .Any();

            if (skipped)
            {
                return(false);
            }

            return(true);
        }
Exemple #3
0
        public bool ShouldRunTest(SystemUnderTest system, TestDescriptor test)
        {
            if (!test.Enabled)
            {
                return(false);
            }

            if (!VersionMatches(test, system.RuntimeVersion))
            {
                return(false);
            }

            var blacklisted = system.CurrentPlatformIds
                              .Where(rid => test.PlatformBlacklist.Contains(rid))
                              .Any();

            if (blacklisted)
            {
                return(false);
            }

            return(true);
        }
Exemple #4
0
 public XUnitTest(DirectoryInfo directory, SystemUnderTest system, string nuGetConfig, TestDescriptor descriptor, bool enabled)
     : base(directory, system, nuGetConfig, descriptor, enabled)
 {
 }
Exemple #5
0
 public Test(DirectoryInfo testDirectory, SystemUnderTest system, string nuGetConfig, TestDescriptor descriptor, bool enabled)
 {
     this.Directory       = testDirectory;
     this.SystemUnderTest = system;
     this.NuGetConfig     = nuGetConfig;
     this.Descriptor      = descriptor;
     this.Skip            = !enabled;
 }
Exemple #6
0
 public BashTest(DirectoryInfo directory, SystemUnderTest system, string nuGetConfig, TestDescriptor test, bool enabled)
     : base(directory, system, nuGetConfig, test, enabled)
 {
 }